Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > tabbed navigation

Reply
Thread Tools

tabbed navigation

 
 
mcnewsxp
Guest
Posts: n/a
 
      11-03-2010
i have setup css and am using <div><ul> <li> tags for my tabbed navigation.
i'd like to put the menu options in an include file. i have an <li
class="active">, but i don't know how to set the "active" page so i am hard
coding the menu in every page.
without asking me for a URL can someone tell me how to make this work.
tia,
mcnewsxp


 
Reply With Quote
 
 
 
 
Adrienne Boswell
Guest
Posts: n/a
 
      11-03-2010
Gazing into my crystal ball I observed "mcnewsxp"
<> writing in
news:iarqt2$i25$:

> i have setup css and am using <div><ul> <li> tags for my tabbed
> navigation. i'd like to put the menu options in an include file. i
> have an <li class="active">, but i don't know how to set the "active"
> page so i am hard coding the menu in every page.
> without asking me for a URL can someone tell me how to make this work.
> tia,
> mcnewsxp
>
>


You could do it server side. I do this all the time.

<?php
$thisurl = "contact.php";

?>
<div id="nav">
<ul>
<li><?php nav("index.php","Home",$thisurl) ?></li>
<li><?php nav("contact.php","Contact",$thisurl) ?></li>
<li><?php nav("about.php","About",$thisurl) ?></li>
</ul>
</div>

<?php funtion nav($uri,$page,$thisurl)

{

if($uri==$thisurl)
{echo "<a href='$uri' class='active'>$page</a>";}
else
{echo "<a href='$uri'>$page</a>";}
}
?>

}

Mine is actually a little more elaborate than that, but I think you get
the idea.
--
Adrienne Boswell at Home
Arbpen Web Site Design Services
http://www.cavalcade-of-coding.info
Please respond to the group so others can share
 
Reply With Quote
 
 
 
 
mcnewsxp
Guest
Posts: n/a
 
      11-03-2010

"Adrienne Boswell" <> wrote in message
news:Xns9E2556E5BF4B3arbpenyahoocom@85.214.73.210. ..
> Gazing into my crystal ball I observed "mcnewsxp"
> <> writing in
> news:iarqt2$i25$:
>
>> i have setup css and am using <div><ul> <li> tags for my tabbed
>> navigation. i'd like to put the menu options in an include file. i
>> have an <li class="active">, but i don't know how to set the "active"
>> page so i am hard coding the menu in every page.
>> without asking me for a URL can someone tell me how to make this work.
>> tia,
>> mcnewsxp
>>
>>

>
> You could do it server side. I do this all the time.
>
> <?php
> $thisurl = "contact.php";
>
> ?>
> <div id="nav">
> <ul>
> <li><?php nav("index.php","Home",$thisurl) ?></li>
> <li><?php nav("contact.php","Contact",$thisurl) ?></li>
> <li><?php nav("about.php","About",$thisurl) ?></li>
> </ul>
> </div>
>
> <?php funtion nav($uri,$page,$thisurl)
>
> {
>
> if($uri==$thisurl)
> {echo "<a href='$uri' class='active'>$page</a>";}
> else
> {echo "<a href='$uri'>$page</a>";}
> }
> ?>
>
> }
>
> Mine is actually a little more elaborate than that, but I think you get
> the idea.
> --


that's what i'm looking for. mine will be classic ASP for this one tho.
i'll try and adapt you code.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to group list into tabbed navigation box jzaiq1@gmail.com Javascript 1 05-05-2007 09:25 PM
Disable the navigation buttons for IE navigation toolbar Laurahn ASP .Net 3 02-06-2007 04:17 AM
Tabbed navigation and CSS kaibo HTML 3 12-29-2005 04:32 PM
A tabbed navigation web control that supports SiteMapProvider? RCS ASP .Net 1 12-21-2005 01:20 PM
Tabbed browsing??? avalanche Firefox 12 12-10-2004 03:09 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57