21487 Posts in 5783 Topics by 2621 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 448 Views |
-
Set which Template to use

2 November 2010 at 12:56am
Would it be possible to select which template file (.ss) to use or does each page type have to be a corresponding pair? By that I mean, does Page.PHP only correspond to Page.SS or can we dictate it within the PHP file?
I want to have two template files for my Page.PHP since I will be using a multi-language set-up.
Can anyone tell me if this is possible? Thank You.
-
Re: Set which Template to use

2 November 2010 at 1:18am
Try to use the renderWith() function.
return $this->renderWith('MyTemplate');
Wiki: http://doc.silverstripe.org/templates#calling_templates_from_php_code
Api: http://api.silverstripe.org/2.4/sapphire/view/ViewableData.html#methodrenderWith -
Re: Set which Template to use

2 November 2010 at 11:56pm
Yes, it is very possible. I was able to implement it to object and pages in our conversion testing.
| 448 Views | ||
|
Page:
1
|
Go to Top |



