3392 Posts in 976 Topics by 852 members
|Go to End|
14 March 2010 at 2:49pm
For a website I'm working on, the homepage needs to have a completely different layout from the rest of the site, also it has a different header and menu, and no foooter.
I tried makin the HomePage a template extending from sitetree first but it was still including the header menu and footer from the Page page type.
Also tried making it a subtemplate of Page and used $URLSegemnt in the <body> tag to create a page id so I could try and remove or make the items display differently in the css file, which half worked, checking the source code once the page had been generated it was showing the homepage with <body id="home"> but none of my #home css styles were being applied to the page.
So is there a way to either make the HomePage page type not inherit from the Page page type, or to remove the header menu and footer in the template?
The only other way i can think of to do it at the mo is to leave the Page page type blank inside the body tags and include the header footer and menu individually on each sub-template except the HomePage.
14 March 2010 at 4:11pm
You are probably using a HomePage sub template (eg a HomePage.ss inside yourtheme/templates/Layout/.) this means that the template parser will use Page.ss in yourtheme/templates which has the header / footer. What you want to do is define HomePage.ss as a root template (in yourtheme/templates/ rather than a subtemplate. Then Page.ss will not be used at all.
Other option is to wrap your header / footer in Page.ss with <% if URLSegment != home %>...
15 March 2010 at 11:54am
Ok I tried again making the HomePage a template in /templates/ folder and it worked this time, not sure what I did wrong before, i don't think I had it in the Layout folder before ... but anyways, working now so all good thanks
|Go to Top|