22404 Posts in 6883 Topics by 2748 members
|Go to End|
5 October 2010 at 7:39am
Is there a way I can control what template is rendered in the $Layout field. I know you can create a pagetype but I was wondering if I could do something like
that would control just the $Layout rendering and not touch the page.
5 October 2010 at 8:51am
Yes you can!
You can pass in an array to the renderWith method where you define templates from specific to unspecific...
This will first look for a template named MySpecialTemplate. If that isn't found, the Page template will be used. This is true for both the main template as well as for the template used for $Layout.
So if you just have a layout named MySpecialTemplate, but no main template, this works equally well. It will render using Page.ss as main template and Layout/MySpecialTemplate.ss for the layout part.
|Go to Top|