Page 1 of 1

change body tag based on page

Posted: Wed Aug 03, 2005 6:16 am
by MySchizoBuddy
I want mt blog page to have
<body id="home">

and my static page"About"
<body id="about">

and so on

Is there a way to change this.

Why I need this. well i can use this information to make a tab permanently highlighted. If the user is on the About page. then the About tag will be highlighted and rest won't. vice versa.

Re: change body tag based on page

Posted: Wed Aug 03, 2005 5:29 pm
by garvinhicking
That should be possible by editing your index.tpl file.

Look for the <body> tag and transform this into:

Code: Select all

{if $staticpage_pagetitle}
<body id="{$staticpage_pagetitle}">
{else}
<body id="home">
{/if}
You'll need a recent version of the staticpage plugin though, because only versions above 2.3 I think allow smarty templating.

Regards,
Garvin