Re: Marking where you are

by "Rudy Gomez" <rudy(at)cyberangler.com>

 Date:  Tue, 30 Jan 2001 09:08:11 -0500
 To:  <hwg-techniques(at)hwg.org>
 Cc:  "Matthew Seaver" <mseaver(at)bigfoot.com>
 References:  gpe59
  todo: View Thread, Original
I've done something similar to this using PHP where the "common page
element" - a nav bar in your case - is a single include file. I also assign
each page a variable.  The include file evaluates the variable and renders
the appropriate HTML.  Even on pages where the variable is not set, the
include file can be made to render some "default" HTML - in your case it
might be the nav bar without any particular link highlighted.

Therefore, you can have a single "nav bar" include file and you simply have
to set a variable.  Perhaps a more elegant solution would not require the
setting of any variable and simply make the script dependent on the current
URL/location...

Here is a simplified example:

<?php $pagename = foo; ?>
<html>
<head>
<title>Test</title>
</head>
<body>
<p>bla bla</p>
<?php INCLUDE "/bla/nav_bar_script.inc"; ?>
</body>
</html>

Lastly, I'm sure you could do the same thing with an SSI.  So, if you want a
single "nav bar" I think you are going to need either a scripting language
like PHP or some server-side process like Perl.

I hope this helps.

Warmest regards,

Rudy Gomez                   \      ,,,,,,\\,,              ...><`>
rudy(at)cyberangler.com    }><(((((())))�� ...><`>
http://cyberangler.com/    /      `````//''             ...><`>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

> <snip>
> >------  Mark where you are  ----
> >I am one of those people who like to have it clear in the navigation
> >which page I am on.  Take the Portfolio page for example.  Even though
> >you have a large clear label at the top of the page that says Portfolio,
> >I'd like to have the page put in context in the navigation links.
> >
> >Home  -  Our Philosophy  -  [Portfolio]  -  Pricing  -  About Us  -
> >Resources  -  Contact Us
> <snip>

> Matt Seaver asked:
================
> How does one go about this?  I have a template or Library file for my
> Navigation bar.  It is the same on every page.  If I change the library
> item, it makes the change on all 22 pages of my site so, by doing I have
> condensed my work time on something like that dramatically.  And since I
am
> not a "paid" professional webmaster, and only do this on my spare time
> (which is very hard to come by), how would I accomplish this and still
have
> an ease of updating the navbar?

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA