Jump to content

[Solved] Multiple RockPageBuilder fields per template possible? How?


Recommended Posts

The FAQ has this information:

Quote

Can I implement sidebar layouts with RockPageBuilder?
Yes! You can create as many RPB fields as you like. For example, one for the normal page content and one where you can provide different elements for the sidebar (e.g. calendar, become a member, news, etc).

So it seems to be possible to add two or more RockPageBuilder fields to the same template. But how do I place them in the template file?

<?= $rockpagebuilder->render(true); ?> does not reflect a certain field.

Link to comment
Share on other sites

Hi @incognito.ms thx for using RockPageBuilder ? 

12 minutes ago, incognito.ms said:

<?= $rockpagebuilder->render(true); ?>

This is just a shortcut for this: $page->rockpagebuilder_blocks->render();

That means it will render the default RockPageBuilder field that you get when installing RPB.

If you add additional custom RPB fields (lets say "foo" and "bar"), you can simply render them like this:

$page->foo->render()
$page->bar->render()

So you could have a 3 column layout like this:

<div id="left">
  <?= $page->foo->render() ?>
</div>
<div id="main">
  <?= $rockpagebuilder->render() ?>
</div>
<div id="right">
  <?= $page->bar->render() ?>
</div>

https://www.baumrock.com/en/processwire/modules/rockpagebuilder/docs/blocks/#rendering-blocks

Does that help?

Link to comment
Share on other sites

  • incognito.ms changed the title to [Solved] Multiple RockPageBuilder fields per template possible? How?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...