Click to See Complete Forum and Search --> : Is this a good use for web site include files?
Azuth
06-19-2002, 10:43 AM
I am in the process of updating a company's web site. They have always used frames to keep navigation simple and consistent. One frame just has a navigation page with a ton-O-links. Well, frames are a bit outdated these days and no one who is anyone uses them anymore.
I am trying to figure out how to keep a consistent look and feel for navigation without using frames or redesigning the navigation for every page. There are about 50-100 pages on this site.
I am considering puting the navigation code(just a table) in an include file and then including it into every page on the site. Is this what most sites do?
Grizzly
06-19-2002, 11:05 AM
Yes - any site worth a salt out there is generally built on a templated system driven by a bunch of includes. Menus, footers, headers, etc etc, should all be stored in a single place on the server, so you can make a change to one file and have it affect the entire site.
In an ideal world, no single line of HTML should *ever* be repeated across a web site. Each line of code should be re-used as much as possible. It makes future changes / updates extremely simple - and also eliminates any chance of inconsistency
GrayCalx
06-19-2002, 02:08 PM
Grizzly's exactly right. Almost every site I do I start out by making a template, spliting that template up into a header and footer file and including that on every page. Depending on variable-oriented you want to get, you can even put the HTML, BODY, TITLE tags in the header file. Then assign the TITLE in a variable, or something similar. This is EXTREMELY important in muli-lingual sites, for the obvious reasons.
Good strategy getting away from frames too, man they're a pain.
daftness101
06-20-2002, 11:24 PM
Sorry I'm not up to date with all this great knowledge, but what do you mean by include files? I'm assuming that you're not talking about include files in ASP and such. Hopefully I'm assuming right.
I agree with you about the frames issue. They're old news, and I should stop using them. The last time I used them was on my personal site that I had to make for a class project.
-Daft
e_dawg
06-21-2002, 05:28 PM
They're talking include files as in include files. It is a term that transcends time and language due to the fact that the name pre-dates more of them, plus it is an excellent description of their purpose.
I'd do it the way you described or with a template system, both of which would be pretty clean. The template system would require a server-side script, so you may have to weight the OS in the equation, but either should work. On this note, templates tend to be a bit easier to manage unless the page layout is tremendously complex.