I am creating a webpage that will have a navigation bar and header that is going to go on every single page, about 100 in total. If I create seperate webpages with all of this material then want to change something in the header I am going to have to go through and do it on all 100 webpages. How can I design the site so I don't have to do that? I hear frames are not the way to go.
SyntaxBlitz
An easy way to do it is to have PHP set up on the server. If you do, you just want to make sure HTML files are parsed by the php parser (I think they are by default) then add the following where the navigation bar should go:
Then just make a file called nav.html and update that to update the entire thing.
If some files are in separate directories, (/pages/index.html and /pages/taco/index.html)
The ones that are in more directories will need require_once("../nav.html"); or require_once("../../nav.html");
You get it?
You can also attempt to do it with Server-Side Includes. (SSI)
Instead of writing just write
I'm fairly sure that method requires no PHP or any other addons; in fact, try that first.
Micky ☼
SyntaxBlitz's answer works really well, if your host is php capable.
If you are concerned about search engines, I would include properly formatted navigation in every page.
If you need to change the links across the entire site, you can use a program that allows 'Find and Replace' across multiple documents, such as Notepad++ (free). Dreamweaver used to do this even in unopened documents and probably still does.
So you can replace the old link code with new and only have to type it once. You would still have to upload all the changed files.
Nia
In case you are using EasyWebEditor as web creation software, this is very simple. Just place the header/navigation bar into a page; then assign this page as "global header" for all the site (you can do this in the Hypertext Properties menu)
Give your answer to this question below!
Orignal From: Q&A: How to create a webpage with static navigation and header?
No comments:
Post a Comment