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.

How to repeat navigation area on all pages

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,

He has: 1,580 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.

Signature links on this forum are NO-follow! - This means spam is futile!

decibel.places's picture

He has: 1,550 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: 585 posts

Joined: May 2007

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