Jump to content

RockFrontend – Using autoload-layout and template-specific latte-files


nurkka
 Share

Recommended Posts

Hi @bernhard, I really like to work with RockFrontend (and RockPageBuilder)!

Now I have some questions resp. want to make sure what would be the best practice:

I am using the autoload-layout feature and am loading a _layout.latte file. But I also would want to make some template specific modifications, like having an element on the startpage, which is not included on all the other pages. I can add this element in home.php, but then it will be included before the opening <html>-tag. When I put the elements into home.latte, this file won't be output until I add the {do $rockfrontend->noLayoutFile = true} directive to it. But if I add this line, the home.latte will of course override my _layout.latte, which is also not what I want.

So I added the following to my _layout.latte:

	...
	{* only on the startpage *}
    {if $page->id==1}
    	{include "src/latte/partials/custom-element.latte"}
	{/if}
</body>
</html>

- Is this currently a recommended way to e.g. have a custom element on the startpage?

- I noticed that content in home.php will always be added to the output, while home.latte will only be added, when using {do $rockfrontend->noLayoutFile = true} in it. Is it possible to load home.latte while preserving _layout.latte, too?

- Is RockFrontend compatible with ProcessWire's MarkupRegions?

- Currently the page in the docs regarding the render()-method is empty. https://www.baumrock.com/en/processwire/modules/rockfrontend/docs/render/

- Is it possible to render any latte-file with render()? Then I could render home.latte within home.php ... but I would again need MarkupRegions to insert the rendered markup in the right place. I tried it, but with no luck so far.

Maybe you have any clues ... and what method would you use to insert template specific markup while using a global _layout.latte template?

  • Like 1
Link to comment
Share on other sites

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