21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1280 Views |
-
Can you render a specific $Layout

5 October 2010 at 7:39am
Hi,
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
$this->renderWith("page-content-right");
that would control just the $Layout rendering and not touch the page. -
Re: Can you render a specific $Layout

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...
An example:$this->renderWith(array('MySpecialTemplate', 'Page'));
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.
| 1280 Views | ||
|
Page:
1
|
Go to Top |


