Sent by David Dorward on 29 July 2004 14:02
On 29 Jul 2004, at 13:59, matt mikulla wrote:
> Hello. I'm learning css and I wanted to know how you folks handle
> creating a
> current "state" of a button/link in a navigational system.
I would use something along the lines of:
unless ($thisPage eq $thisLink) { print $htmlForThisLink; } else {
print $justTheLinkTitle; } [1]
.... in my homebrew HTML preprocessor (I've been planning to implement
this for a while (cough)). This would avoid outputting any link at all
for the current page rather then messing around with styling a link
differently.
> I've seen it done
> this way:
>
> <li id="active"><a href="#" id="current">Item one</a></li>
> However, what If I want to use server side includes to make my
> navigation
> cosistent throughout the site? Would I have to serve a different
> navigation
> file for all pages that use item one, item two, or item three.
Yes. Hence why I use the preprocessing (which could also be done with
server side scripting) to generate the links for
> Or is there a clever way Css can handle it.
You could use a combination of attribute selectors and body ids ... but
that won't work in IE. You need to fiddle with the HTML for this I'm
afraid.
[1] This is heavily simplified. My system actually builds up an array
of hashes for each page which get pumped into HTML::Template. I might
publish[2] the system at some stage.
[2] There is an HTML preprocessor on my site (Dolt), which gets a
surprising number of hits. It is interesting for a number of reasons,
not least of which is that it is the first truly useful piece of
software I wrote. On the downside, it is _very_ basic, being limited to
simple includes, requiring line breaks before and after each include,
and not being able to deal with subdirectories. It worked well enough
at the time though.
--
David Dorward
<http://dorward.me.uk/>
<http://blog.dorward.me.uk/>
______________________________________________________________________
css-discuss [EMAIL-REMOVED]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/