| 10:25 pm on Jun 23, 2008 (gmt 0)|
Use server side includes. One text file with the insertion of a bit of code and viola, your entire code is inserted and you have your navigation. This is also good for header and footer information
<!--#include virtual="/ssi/navbar.shtml" -->
From what I have learned, you are always supposed to save your pages with the .shtml extension. I have used them and I love them.
Also, create a directory for all your includes to be held in. If you use them for more then your navigation.
Hope this helps!
| 11:24 pm on Jun 23, 2008 (gmt 0)|
If you have php, you can use php includes in a very similar fashion
<?php include ("myIncludesDirectory/myNavBar.php"); ?>
Such a file like myNavBar.php would contain the EXACT same bits of html code and nothing else... i.e. for a navBar, just the links, no <head> or <body> tags, etc)
I think that a file like navbar.shtml would have to have the <head> and <body> tags...
maybe I'm wrong...
|This is also good for header and footer information |
The php approach (and maybe the .shtml approach, too?) is good for ANY repetitive data...
e.g. DOCTYPE and MIME type declarations (ought to be useful when HTML5 comes out)
meta tags in the <head>
| 4:34 pm on Jun 24, 2008 (gmt 0)|
|I think that a file like navbar.shtml would have to have the <head> and <body> tags... |
maybe I'm wrong...
Maybe I'm wrong, but I don't use head and body tags in any of my ssi. I do just the same as php include - exact code and nothing else.
| 10:19 pm on Jun 24, 2008 (gmt 0)|
The file that you are creating as an include would just include the portion of the area that you are using. Such as the navigation.
What you would do is take the whole area of the list that you are using. If I have the list within a div, I just cut the information out of the div, put it into a text file and insert the ssi code. It is really easy to do.
You can always do a search on google for tutorials on this. There are a number of them out there that are really great to read.
| 10:46 pm on Jun 24, 2008 (gmt 0)|
Just to clarify, you can use SSI's to include ANY valid data - some useful examples -
- Plain text file (no headers required, a single word, even)
- output from a script or a compiled program (see SSI man. for exec directive). In this case, you must print content-type: text/html headers from your external program (or other valid content-types.)
- RSS/XML (but your document has to be a valid XML/XHTML doctype and you have to provide XML headers)
- image or other binary data
Basically anything you can output in a page you can include in the page using SSI. It doesn't have to be a valid HTML/XHTML document - in fact, doing so might screw up a perfectly valid document:
<!-- below is my include, do the math! -->
<p>Two plus Two.</p>
<!-- End of my include -->
The data you include becomes part of the page, so you just validate the entire .shtml with all the data imported.
In older server O.S's the use of SSI's presented serious security flaws and it was a memory hog (because it parses files before reading instead of straight serving) but it's no longer the case.
| 2:07 pm on Jun 27, 2008 (gmt 0)|
If your using dreamweaver just use the template function. I can see the magic word here is "codeing" and to create that would be hard, but i found the template system quite useful and so much faster.