Jump to content

[SOLVED] behaviour of renderLayout changed?


gebeer
 Share

Recommended Posts

Hi @bernhard we just updated RockFrontend on a site from 3.20.0 to 3.23.3 and the site stopped working.

I fixed it by changing  templates/_main.php

<?= $rockfrontend->renderLayout($page); // worked before update ?> 
<?= $rockfrontend->render($page); // works after update ?> 

We use RockPageBuilder and in templates/sections/main.latte

<div sortable x-ref="additional-sections">
 {$page->get('rockpagebuilder_blocks')->render()|noescape}
</div>

Now after the update that threw an error on our home page because template home has no field rockpagebuilder_blocks

rockfrontend-error.thumb.png.d5addf88423119e2d23b1a0306f41b64.png

I am wondering why this is. Do you have any idea?

I looked at the function signature for render() and the examples in the PHPDoc do not mention that we can pass a Page object as $path argument. So I thought we could not call render($page) at all. But it works. I guess because $page is then overwritten with $this->wire->page.

So renderLayout($page) would be the correct method to use. But something in the inner workings of renderLayout must have changed and stopped the site from working.

I suspect that the way we have setup rendering with RockPageBuilder, RockFrontend and Latte is fundamentally wrong.

 

Link to comment
Share on other sites

  • gebeer changed the title to [SOLVED] behaviour of renderLayout changed?

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...