External Navigation
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.
wWw.SqUiRmS.cO.nR
Busy posted this at 22:31 — 8th July 2005.
He has: 6,151 posts
Joined: May 2001
server side scripting (PHP, asp etc) or javascript include
CptAwesome posted this at 22:56 — 8th July 2005.
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 posted this at 23:05 — 8th July 2005.
He has: 6,151 posts
Joined: May 2001
frames are evil
CptAwesome posted this at 23:06 — 8th July 2005.
He has: 370 posts
Joined: Dec 2004
Oh, I agree completely, but he needs to have his options.
Maquar posted this at 08:48 — 16th July 2005.
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 posted this at 15:39 — 16th July 2005.
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.