You assign an extra class to the link that relates to that page. With the vanilla tabs, all the links have class="TabOff" except the active one, which is defined by class="TabOn" this means that, that specific tab can be given extra styling.
well, I suppose I can show you the site and you can help determine the best route? If it's not too much hassle, that is.
http://onemanshortproductions.com
you could set a body id on your pages if you want to do a pure css version. then in the css when the body id is present it will apply a different style e.g.
<body id="home">
<a href="/" id="homeNav">home</a>
then in the css put:
#home #homeNav{
font-weight:bold;
}
well, on the basis that your pages are defined in a ?page=whatever statement, for your css if you use a body tag such as:
<body id="<?php echo $_GET['page']; ?>">
Which should work. I think.
That doesn't work... It produces a blank id statement... I also tried useing echo $_SERVER['QUERY_STRING']; which didn't work... I'm not even sure what that would so anyway, lol... I posted the actual coding I use above... so if that can help you at all. Thanks for being helpful.
my pages arent ?page=whatever
they are
?whatever
I have an index page that is designed the way I want... in the body tag I insert the php command I posted 10 posts up... I have individual php files that it calls into the body of the index page. When I click on say Opportunities link the href="?opportunities" it then calls opportunities.php into the body.
Yeah. That'l teach me to half read discussions :)
In that case, assuming its in the same file, you can use:
Unless its in a different file or above where query is set, in which case you can use:
<?php
$query = $_SERVER['QUERY_STRING'];
$query = explode(':',$query);
?>
<body id="<?php echo $query[0]; ?>">
And then remove the definition of query lower down.
Was bored so I fiddled for a little bit with this. This is what I got
http://hatethis.org/temp/tabs.txt
Its nothing fancy, but it worked with the way you are calling pages.
sorry Mr F. i read this with the intention of replying then had to shoot out to work and forgot about it. We really need that 'mark as unread' thing goin on.
I must be a right prick, but...
Is there a way I can have Home to be TabOn when you first enter the page...
the page loads as http://onemanshortproductions.com but it's the same as http://onemanshortproductions.com/?news
I tried adding or "index.php" to the php statement for home but that keeps it on forever. I want it Home to be tabbed on when there is no ? and when it's on ?news. If this is not possible, just let me know
Just a guess, but give this a go...change:
if($_SERVER['QUERY_STRING'] == 'news')
to:
if($_SERVER['QUERY_STRING'] == 'news' || !$_SERVER['QUERY_STRING'])
Comments
You'd just need to set up a little If statement for each tab, like If the page equals 'news' then echo TabOn otherwise echo TabOff