php and unordered list navigation menu include
Posted: Fri Dec 15, 2006 4:39 pm
feyd | Please use
and here is my list navigation:
does anyone know why this wouldn't work, or if there is a better way?
Thank you for any help you can provide
---
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hello,
I was wondering if someone could help me out... I am making a navigation menu using css and unordered lists, the list is inside an include file and I have set up the list so it has 3 states (default, hover, and active) I am trying to have the code read the page_id(file name) and then have it generate id=current in the list... like <li id=current> but I keep getting all kinds of errors.... I can't put anything on the pages specifically because they are generated, so it has to go in the include...
Here's what i've messed up so far
This is in the top:Code: Select all
<?php
if(!$_GET('page_id')) { $tab1 = 'id="current"'; }
if(!$_GET('page_id') == 3) { $tab2 = 'id="current"'; }
if(!$_GET('page_id') == 4 ) { $tab3 = 'id="current"'; }
?>Code: Select all
<div id="navwrapper">
<ul id="nav">
<li$tab1><a href="<?php echo get_settings('home'); ?>/"><span>Home</span></a></li>
<li$tab2><a href="<?php echo get_settings('home'); ?>/Calendar/"><span>Calendar</span></a></li>
<li$tab3><a href="<?php echo get_settings('home'); ?>/?page_id=4"><span>Phonebook</span></a></li>
<li$tab4><a href="<?php echo get_settings('home'); ?>/Links/"><span>Links</span></a></li>
<li$tab5><a href="<?php echo get_settings('home'); ?>/Contact/"><span>Contact</span></a></li>
</ul>
</div>Thank you for any help you can provide
---
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]