![]() |
tabbed navigation
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 |
Re: tabbed navigation
Gazing into my crystal ball I observed "mcnewsxp"
<mcbassguitar@yahoo.com> writing in news:iarqt2$i25$1@news.eternal-september.org: > 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 |
Re: tabbed navigation
"Adrienne Boswell" <arbpen@yahoo.com> wrote in message news:Xns9E2556E5BF4B3arbpenyahoocom@85.214.73.210. .. > Gazing into my crystal ball I observed "mcnewsxp" > <mcbassguitar@yahoo.com> writing in > news:iarqt2$i25$1@news.eternal-september.org: > >> 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. |
| All times are GMT. The time now is 04:34 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.