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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.