How to render child page builder output on parent

I’m using the Builder plugin from @timoetting which works great by the way!

I need to render output from a child page which has builder in it’s blueprint on to it’s direct parent page.

This is the output normally used, but how can I adjust it so it fetches the builder from a certain child page?

<?php foreach($page->builder()->toStructure() as $section): ?>
         <?php snippet('sections/' . $section->_fieldset(), array('data' => $section)) ?>
       <?php endforeach ?>

You can either use the path to the page or use find():

<?php foreach($page->find('some_page')->builder()->toStructure() as $section): ?>
    <?php snippet('sections/' . $section->_fieldset(), array('data' => $section)) ?>
<?php endforeach ?>

or

<?php foreach(page('path/to/page')->builder()->toStructure() as $section): ?>
    <?php snippet('sections/' . $section->_fieldset(), array('data' => $section)) ?>
<?php endforeach ?>

I think your could even skip ->children()

@timoetting is right, I corrected it above.

Thanks @texnixe and @timoetting! I completely forgot the find() function, I’d better read the docs again :wink:

@texnixe @timoetting It works perfectly! So how can I close this one as solved?

Click on the pencil icon next to the topic title and change the category from question to solved :slight_smile:

Thanks, forgot that also :slight_smile: