-
Arrow Green Vertical Menu - SSI question
Hi, all.
Is it possible to use the "selected" feature with this code if I have the nav bar code in an SSI file?
What I mean is, when you're on a page, the navbar displays the current page as "selected", therefore a different image on that <li> on the navbar.
I'm doubting it, since the class="selected" code has to be put into each individual page, and that's not possible, since it's just accessing the navbar with SSI.
But if it IS possible, let me know, thanks!
-
-
What you would need to do is add some server side scripting to the SSI that would determine the page requesting the include. Once you have done that, then you would tell it to echo the selected class attribute on the appropriate <a> tag.
For Example
$page = basename($_SERVER['SCRIPT_NAME']) // determines name of page requesting include.
<li><a href="http://www.happy.com/about.php" <?php if ($page === "about.php") { echo "class=\"selected\"";}?> title="About Me">About Me</a></li>
Don't confused the address in the <a> tag with the requesting script the SSI is being sliced into.
The if conditional statement is only executed if the page is about.php. You would need to add this if statement to each of the <a> tags in the SSI. I'm sure there's another way, however I know this should work.
-
-
Well, yuh lost me, lol. I don't know PHP at all.
-
-
Will this work with SSI?
nevermind....
Last edited by Geezer D; 10-18-2008 at 12:06 AM.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks