http://qs321.pair.com?node_id=27151

rodry has asked for the wisdom of the Perl Monks concerning the following question:

What is the most common, standard way of programatically implementing a navigational bar that indicates the visitor the are of the web site that they are looking at?

Thanks in advance.

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How can I indicate the current page?
by PotPieMan (Hermit) on Aug 09, 2000 at 23:51 UTC

    I'm not sure if I fully understand what you want your navigation bar to do.

    On my web site (which I would link, but I'm serving it off a 28.8kbps modem), I wrote a script to generate my header. Contained within the script is a hash of navigation links that I want to display. For example:

    my %links = ( "1" => ['/channels.shtml', 'channels'], "2" => ['/mp3s/', 'mp3s'], "3" => ['/fortune.shtml', 'fortune'] );
    Then, when I am generating the navigation links, I get the request URI ($ENV{'REQUEST_URI'}) and compare it to the values of the anonymous array in the hash. If the path is the same, I bold the link. For instance:
    foreach(sort keys %links) { if ($uri eq $links{$_}[0]) { print "<STRONG><A HREF=\"$links{$_}[0]\">$links{$_}[1] +</A></STRONG>"; } else { print "<A HREF=\"$links{$_}[0]\">$links{$_}[1]</A>"; } print " | "; }

    Like I said, I don't know if this is what you wanted.

Re: How to? Dynamic navigational bars.
by rodry (Beadle) on Aug 09, 2000 at 23:23 UTC
    Update: Let's say a navigational toolbar as links A, B, and C. I want the link to A to turn bold when the user is viewing that area. Likewise, I want the link to B to turn bold when the user gets there, and so on.

    I thought this was done thru CGI. Then I read an article that implied that this could be done thru SSI alone.

    I was left wondering so I decided to ask which way to pros (like the visitors of these pages) prefer to do it.:)