|What are Server Side Includes. What is SSI. Making site navigation easy.|
Server Side Includes
How many pages does your site hold? 5, 10 or 100? Then you know how hard it is to add a change in your site's navigation or menu structure, and how boring and time consuming making a simple change can be! Here's an easy way using Server Side Includes.
What are Server Side Includes or SSI.
SSI is sort of like using your HTML server as a cut and paste editor. The server reads the document and parses it for directives. Follows the instructions that it finds and merges their results into creating a finished document. The document is then sent to the client browser.
Making site navigation easy with the use of Server Side Includes (SSI)
The most common use of Server Side Includes is to edit a large amount of pages, just by editing one file. If you have a large site, using server side includes can make it a simple task to update your pages. I use server side includes in the top, side and bottom menu bars of this page. If I want to add another page to the menu or change a link, then I only have to make a change within the text file and it is done. If you use an editor like Dreamweaver, Frontpage or similar, just open the text file, make the change, save and its done.
By using simple Server Side Includes (SSI) you only need to change one text file and all your pages are automatically updated and that means less work for you.
There are 3 ways that you can achieve the same result, that is to make a change to one file that is reflected throughout your entire site.
In order to use Server Side Includes, your server must be configured to support them.
First, check that your server supports them and if you are not allowed to do SSI- consider moving to someplace where you can! But there are ways to still make it
possible. Find out how below!
Server Side Includes using .shtml extension;
If your server does not allow the use of .htaccess then simply make, or change, all your pages from .html to .shtml and use the the example above from step 2.
Another alternative to using SSI
Document - in - Document
Want to add the power of SSI to your site but your web host doesn't support it? Don't want to change all your pages over to .shtml? Then this is for you.
This is a scriplet that allows you to include a document inside another document easily, simply by specifying the URL of the external document inside the scriplet!
By including the scriplet below in multiple pages, a change to the target external document is instantly reflected on ALL of these pages. Unfortunately document to document is only supported by IE4 +. All other browsers will see nothing. Doesn't seem to work in ie 7.0
Take a look at the source code for this page and note that I have used this method on the navigation table at the bottom of the page. If you can't see it then your browser doesn't support this method.
Adjust the width and height to suit and change "yourpage.html" to whatever.