17488 Posts in 4473 Topics by 1978 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 838 Views |
-
Templating Question

14 April 2008 at 3:03pm Last edited: 14 April 2008 3:05pm
I am setting up a site which effectively splits off into 2 sub sites.
HOMEPAGE
Section 1
- Some Page
- Some Other Page
Section 2
- Some Page
- Some Other PageMy problem is I wish for each section to use a seperate master template. It is so I can vary the css and javascript between them.
At the moment it works fine for Level 2 ( Section 1 & 2 ) but as soon as I move down into Level 3 it reverts back to using the Page.ss template, am I missing something?
cheers
-
Re: Templating Question

17 April 2008 at 10:36am
Hmm, what is your inheritance structure?
I was thinking that Homepage is of type Page. Then you have two Page subclasses, something like "class Section1 extends Page" and "class Section2 extends Page." And then your master templates for those sections would be Section1.ss and Section2.ss. If this is what you have, make sure your level three pages are of Section1/Section2 page type, or a subclass thereof. Also make sure your two master templates are in every level of your template folders (i.e. template, templates/Layout, etc)
Also, you can force you level 3 pages to render with particular templates using the page controller with something like this:
return $this->renderWith(array('SomePageSection2', 'Section2'));
So, it will look for SomePageSection2.ss and then Section2.ss to try and render the page with.
Does this help? If not, what is you template folder structure?
Cheers.
Mike
| 838 Views | ||
|
Page:
1
|
Go to Top |


