views:

199

answers:

2

In the past I have created websites with navigation that is aided by php $_GET variables. There was a layout that was implemented, and then content that was included based on the variable passed into the URL.

I am now creating a website without any server-side help. I am wondering what are good ways to navigate pages without the redundancy of having the layout repeated in multiple html files.

What kind of navigation methods have you used in the past, and what did you think was the most acceptable/cleanest?

A: 

You mean you have all static files? Maybe you can use AJAX?

PEZ
Yes I do mean all static files. AJAX seems is a possibility, although there is a learning curve that I would have to climb.
There's not all that much to learn to get started with AJAX. You could use one of all those excellent JavaScript libraries out there to take some of the pain out. But otherwise it's mainly xmlHttpRequest, provide a callback and catch the result there.
PEZ
AJAX may not be the best method because then the Search Engines like Google cant see your content.
Unkwntech
Why would you assume that?
PEZ
The only thing that's server-side about AJAX is that it requests pages from the server through the browser... does that mean he can't use a web browser for this either?
Ant P.
+1  A: 

It's not very clear what kind of limitations you've been stuck with, but let's try:

  1. if you've got a web server and the server is Apache consider Server Side Includes;
  2. if you're running a static site from a CD or such you can use a preprocessor to create the static pages including the menu at compile time. Google for 'HTML preprocessor', there are scores of them;
  3. they're rightly despised and 'so last century', but have you considered HTML frames?
djn
I have used frames in the past, but I used the term "acceptable" in the question because I felt that they were frowned upon in general. Anyways, I will check out Server Side Includes and HTML preprocessors.
I went ahead and used this preprocessor http://www.cabaret.demon.co.uk/filepp/ and I set up a script that builds all the pages. It works nicely.