The University of Adelaide | Home | Faculties & Divisions | Search |
|
|
|
Using Server Side IncludesServer Side Includes are instructions to the server to include a specified HTML file within the current HTML document when it is displayed. Placing a SSI in a document inserts a reference to the external HTML file. Then when the page is displayed the reference to the file is replaced by the contents of that file. Any changes to the external file are automatically reflected in every document that includes it. Why the templates use SSIServer Side Includes simplify HTML code by allowing commonly used elements of a page to be placed in a separate file. This makes it easy to change key elements on a web site in one place, rather than having to make the same change on every single HTML page on the site. For example, if your pages share a common banner, you can put the code for the banner in a separate HTML file and 'include' that banner on each of the pages that use it rather than hard coding it on each page. Any changes made to the banner are then automatically reflected in all pages that include it. How to perform a SSI in a HTML fileA Server Side Include is entered in a HTML document as a comment referring to the HTML file to be included when the page is displayed. A Server Side Include looks like: <!--#include virtual="/foo/bar/blah.html" --> When the page is served to a browser, the server will read all included files and insert them into the page in place of the reference before sending them to the browser.
|