View Full Version : Loading nav elements?

07-11-2005, 07:35 AM
On a web site with 8-9 (or more) pages, I have a navbar/menu which is "coded" (types) in the source of every .htm page. If I decide to change the wording of one of the navbar items, I need to do this in the source of every page.

Is there any way I can load the navbar code instead from an external text file or something, instead of having it on either page? I don't think this is possible with CSS, but considering this is the "HTML & CSS" forum, I thought it worth a shot :)

I also set the "active" page (gets a different bkground), this also needs to be catered for.

Example of page code:

<div class="pagecontainer">

<div class="topcontainer">
<div class="titlearea" id="home"></div>

<div class="navbararea">
<div class="navbar">
<li><a href="#" id="current">Home</a></li>
<li><a href="aboutme.htm">About me</a></li>
<li><a href="favorites.htm">My favorites</a></li>
<li><a href="sports.htm">Sports</a></li>
<div class="navbar">
<li><a href="reviews.htm">Reviews</a></li>
<li><a href="pictures.htm">Pictures</a></li>
<li><a href="blog.htm">What's going on?</a></li>
<li><a href="sitemap.htm">Site map</a></li>

<div class="locationarea">Home</div>

<div class="bottomcontainer">
<div class="bottomarea">Bottomarea</div>


I've thought about using frames, but am not a big fan of this.


07-11-2005, 12:56 PM
dynamic? afaik no.

learn php?
use flash or cgi?

i believe these are your options for html includes... other than frames.

with the "highlight" stuff, you could be tricky and use fancy directories and local paths to bg's ... (blog.gif and sports.gif in folder /inactive is different than those in /active)... but thats not very versitile, and a waste of space.