change body tag based on page

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
MySchizoBuddy
Regular
Posts: 340
Joined: Sun Jun 12, 2005 5:28 am

change body tag based on page

Post 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.
Image
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: change body tag based on page

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply