How to repeat navigation area on all pages

You are viewing this site as a guest. Join our community to get your questions answered and share knowledge. Active members may advertise and ask for a website critique.

They have: 7 posts

Joined: Oct 2008

Hi everyone -

This is pretty basic, I think, but I'm a beginner..

In writing a strict XHTML site, what's the 'best practice' way to keep the same top/side nav across multiple pages of a site so that I just have to edit one place to change it on all pages? Then each page would have a content area specific to the page.

I appreciate any guidance!

Thanks,

DeveloperModerator

He has: 1,428 posts

Joined: Nov 2005

The most common method is using a server side language such as PHP, and 'including' another file.

Something like "header.php" which would be all your most common used requirements (nav links etc) and can be included in each page as required.

In a world without fences and walls, who needs Gates and Windows?

decibel.places's picture

He has: 1,557 posts

Joined: Jun 2008

There is a tutorial on Tizag that explains what you want to achieve

You could also do it with a JavaScript file, but PHP is a better choice.

He has: 465 posts

Joined: May 2007

If your host allows it, Server Side Includes (SSI) is a simple solution.

Subscribe to this feed: Syndicate content