|
Helping ordinary people create extraordinary websites! |
The Basic Uses Of SSI - Server Side IncludesBy Sean Burns2003-10-14
How To Use SSI So, how do you use it? The easiest way I have found is to design a template for your pages in your editor of choice. You then decide which parts of this page will be standard across your whole site - this will generally be the top bit (your header) and the bottom bit (your footer). If you have a menu down the left (or ads like we have) this could be an extra file - only if the menu needs to be different on different parts of your site. We include the left column as part of our header because it doesn't change. You then copy the HTML for these sections to new files called header.html, footer.html and possibly left.html (or whatever you want to call them). Then, in the original page you have created, replace the HTML you just removed with this - <!--#include virtual="/header.html" --> for the header, <!--#include virtual="/footer.html" --> for the footer and <!--#include virtual="/left.html" --> for the left column (if required). Note that you need to call the files from the correct place - if you have put them in your root directory (where your main page is) then what we have here is correct. If you set up a new directory for them, you will need to reflect this. Tutorial Pages: » Introduction To SSI - Server Side Includes » How To Use SSI » Extensions And Hosting » One Last Tip On SSI |
|