Click to See Complete Forum and Search --> : editing navigation links on multiple pages
RobSoukup
09-19-2007, 11:54 PM
Is there a way to create a navigation template that shows up on every page in the web site - yet have an edit change the template change all pages in the site? How do web designers keep from having to opening all their web pages if they want to change one link in their navigation index?
I don't want to use frames if I don't have to. I don't know PHP yet.
sticks464
09-20-2007, 01:09 AM
The easiest way is to use ssi (server side includes).
It only takes a few steps
1. Create a file with only the navigation contents, no doctype, head, body or html tags ie.
<ul>
<li><a href="home.html">Home</a></li>
yada yada yada .....
</ul>
Name this appropiately ie. menu.html
2. In the container that will hold the menu on each page insert this code
<!--#include file="menu.html" -->
Rename the file type extention of this page to shtml so that every page with the includes statement is shtml and not htm or html.
Make sure to remove the menu tags from this page so the code for the menu only appears on the menu.html file.
3. Upload all files to the server.
Major Payne
09-20-2007, 01:19 AM
Name this appropiately ie. menu.html
2. In the container that will hold the menu on each page insert this code
<!--#include file="menu.html" -->
Rename the file type extention of this page to shtml so that every page with the includes statement is shtml and not htm or html.
Make sure to remove the menu tags from this page so the code for the menu only appears on the menu.html file.
3. Upload all files to the server.#2 is only correct if menu.html and other files using the include are in same directory. For pages in other directories that will call the menu include use:
<!--#include virtual="/menu.html" -->
Ron