Jump to content

navigation - how can i get the id of an active tab


ricky spires

Recommended Posts

hello

 

navigation - how can i get the id of an active tab

 

i have a top nav which is pulling its tabs from a database how can i get the id of the active tab then pass it in a global to side navigation

 

this is the top nav code

 

<?PHP
require_once("../includes/initialize.php");
global $topNavs;
global $pageName;
?>
<div id="navWrapper">
<?PHP
$topNav = navL1::find_all();
?>
  <div id="ddtabs3" class="solidblockmenu">
<ul>
<?PHP foreach($topNav as $topNavs): ?>

<li><a <?PHP echo ($pageName == $topNavs->title ? 'class="selected"' : '')?> href="<?PHP echo $topNavs->title; ?>.php" id="<?PHP echo $topNavs->title; ?>"><?PHP echo $topNavs->title; echo $topNavs->id;?></a></li> 
    
    
<?PHP endforeach; ?>
</ul>
</div><!--  #ddtabs3-->
</div><!--  #navWrapper-->

 

 

this prints the id of 5 which is the last tab in my database. if i have tab 1 active how can i get my loop to get that id ?

 

thanks

rick

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.