3367 Posts in 946 Topics by 846 members
|Go to End|
11 January 2009 at 11:33am
Question is whether or not it is possible to use $Layout multiple times in a Page.ss for example. I want to insert "page type specific code" in multiple locations of the Page.ss file - not just the conventional use of $Layout to determine the content area template code by page type but also, for example, parts of the <head> area.
I realise that using $Layout to do this isn't probably the best why but I don't know another way in SS.
Perhaps there is a way to use <% include %> statements conditionally based on Page Type? E.g. <if pagetype == blahblah> or something?
I actually also tried to create a new "Layout-like thing" by creating a directory called "Head", putting a page type specific .ss file in there, and referencing $Head in my root Page.ss file. This didn't seem to work. I guess Layout/$Layout is a hardcoded built in function?
Thanks for any ideas in advance...
11 January 2009 at 11:46pm
how different do your pages need to be? What exactly do you need to be in your header that you can't do with normal functions (like require, $Metadata etc?
You can do conditional statements based on page class like this: <% if ClassName = ClassType %>
That way you could have conditional statements in your include, but that could get a little messy.
If you elaborate on what exactly you need we may be able to find a better way
|Go to Top|