External Navigation

Squirms's picture

He has: 7 posts

Joined: Jul 2005

Is it possible to make a section on my site have a contence list from another page?

What i want is for the website thsite.co.nr to get the navigation bar (that is the bit that has all the links to other pages on my site) to be from another page so that everytime i add a new section to my website i dont have to go through every page updating the nav bar.

I tryed it with frames but the links just make that frame change. What i want is some simple html.

Laughing out loud

wWw.SqUiRmS.cO.nR

Busy's picture

He has: 6,151 posts

Joined: May 2001

server side scripting (PHP, asp etc) or javascript include

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

You can do it with a frame, and if you set the target="_top" that will escape the frame.

Busy's picture

He has: 6,151 posts

Joined: May 2001

frames are evil

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

Oh, I agree completely, but he needs to have his options.

They have: 32 posts

Joined: Nov 2003

Why not just use a php include (as busy suggested)? It is fast and easy, provided your web hosting supports php!

Example:

You have your navigation links in a file called "nav.php" and that file would reside in a folder called "includes". Then wherever you want to have the links show up you would simply add the php include on the page where you would want it to appear. You also have to rename your page with a .php extension.

Make sure there are no tags and tags etc in the nav.php only your links, text and your classes (to decorate the links).

From then on out, you simply make your changes to the nav.php, upload it and your changes take effect everywhere you have the include.

If you need more help just holler!

Mark

CptAwesome's picture

He has: 370 posts

Joined: Dec 2004

in addition to what Mark said, if the sites are on the server, with different domains, with php you can go "below the waterline" so if you have
/htdocs/domain1.com
/htdocs/domain2.com you can have
/htdocs/includes and to access the code would be include('../includes/nav.php');

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.