Edward Ver Posted 4 hours ago Share Posted 4 hours ago Hi All, I'm still learning PW, and loving it. But, I'm no PHP coder. My Problem is how to output fields from another page inside a repeater. <?php $showcase = $pages->find("template=work_details") ?> <?php foreach($showcase as $showcases): ?> <div> <p class="pb-2 text-left"><?= $showcases->work_hero_subheading ?></p> // This is inside a repeater called "work_hero_repeater" </div> <?php endforeach; ?> But there is no output. Thank you for any help. Link to comment Share on other sites More sharing options...
Gideon So Posted 1 hour ago Share Posted 1 hour ago Hi @Edward Ver Welcome to the forum and the world of ProcessWire. Please try the following code. Please note the comments to see if you get the idea. <?php $showcase = $pages->find("template=work_details") ?> <?php foreach($showcase as $showcases): ?> <div> <?php foreach($showcases->work_hero_repeater as $whr): ?> // You need to loop therough the repeater because repeater is an arrray. <p class="pb-2 text-left"><?= $whr->work_hero_subheading ?></p> // Then call the field in the repeater item as you need" <?php endforeach; ?> </div> <?php endforeach; ?> Gideon 1 Link to comment Share on other sites More sharing options...
Edward Ver Posted 1 hour ago Author Share Posted 1 hour ago Got the idea and it works. Thank you very much! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now