There are two solutions, as I see it. The first is to generate content, be it the document, the include, or the style sheet. The second is to import a common style sheet into a section-specific one.
I'll be assuming a menu structure along the lines of:
HTML Code:
<ul class="navigation-menu">
<li><a href="/">Home</a></li>
<li><a href="/products/">Products</a></li>
<li><a href="/support/">Support</a></li>
<li><a href="/about-us/">About Us</a></li>
<li><a href="/contact-us/>Contact Us</a></li>
</ul>
for the basis of the discussion below. It will be modified at various points, though depending on the appearance you're aiming for (you haven't specified), the modifications may not be the most appropriate. Still, it will suffice as a general guide.
I'll describe the second approach (importing) first as it won't take long. However, it's probably not the choice I'd make.
The general idea is that for each section (Products, Support, etc.) there will be a single, small style sheet. All it will do is select a particular menu item, and modify it superficially. It will rely on a broader, imported style sheet to actually provide the bulk of the presentation.
The first step is to provide 'hooks' into the markup; specifically the addition of id attributes:
HTML Code:
<ul class="navigation-menu">
<li id="home"><a href="/">Home</a></li>
<li id="products"><a href="/products/">Products</a></li>
<li id="support"><a href="/support/">Support</a></li>
<li id="about-us"><a href="/about-us/">About Us</a></li>
<li id="contact-us"><a href="/contact-us/>Contact Us</a></li>
</ul>
Each section-specific style sheet will then follow the general form:
Code:
@import url(/common.css);
#section-id {
/* ... */
}
All documents within a particular section would then include the relevant style sheet.
Simple enough. So, why wouldn't I do this? There are a few reasons. The first is that it's clumsy. Not only is it necessary to litter the server with several small files, but these files are almost identical in content. The second is that it adds a maintenance burden. If you choose to alter the appearance at a later date, you'd have to modify each file. Finally, from a usability perspective, documents shouldn't link to themselves. As it is, the menu itself will not change to reflect the current location within the site.
For the first approach (generating content), the only question is what to generate. The style sheet is one idea. Each link element can include the section in the query string:
HTML Code:
<link rel="stylesheet" type="text/css" href="/css/section?products">
to produce a small style sheet similar to the one above. This takes care of the first two issues I mentioned, but it does still leave the third. A style sheet is also one of those things that should be cacheable, if for no other reason than that the server shouldn't have to waste time on something so simple. Provided that you can set HTTP headers, generated content can (and should) be made cacheable, but it is a little extra work.
A slight variation on this involves modifying the document itself. Instead of importing a common style sheet through a section-specific one, the common style sheet can be linked directly. The section-specific rules can be written directly into an embedded style sheet, instead. However, I'd say that this reintroduces a maintenance burden as style data is now being generated within the content. Also, this might be difficult to do simply if all of your documents are being generated by separate files.
The final option then, and the one I'd be most inclined to choose, is modifying the include. The style sheet can be written as one file, using a class attribute, rather than id attribute, selector:
Code:
ul.navigation-menu li.current-item {
/* ... */
}
The matching markup would look along the lines of:
HTML Code:
<ul class="navigation-menu">
<li class="current-item">Home</li>
<li><a href="/products/">Products</a></li>
<li><a href="/support/">Support</a></li>
<li><a href="/about-us/">About Us</a></li>
<li><a href="/contact-us/>Contact Us</a></li>
</ul>
Notice that the source anchor has been removed for the current location.
Not having used ColdFusion, I couldn't tell you the best way to go about doing this, though. Nevertheless, I hope this helped in some way.
Mike
Bookmarks