University of Minnesota Morris Computing Services

 
UMM Home > Computing Services > Guides > Web Design > Server Side Includes

Server Side Includes

Server Side Includes (SSI) can allow a web page designer to create and manage some content across multiple pages simultaneously. For example, includes allow a designer to add a footer or header to all files referencing the include, or to insert document information such as last modified times automatically. SSI lets you embed a number of special 'commands' into the HTML itself. When the server reads an SSI document, it looks for these commands and performs the necessary action.

Examples

There are many uses for SSI, here are few examples of using:

Adding a SSI page element to many documents

Add the following text to the part of your page(s) you want to manage:

<!--#include virtual="yourfile.shtml" -->

This will allow you to edit the "yourfile.shtml" file and have all pages that reference the "yourfile.shtml" file be updated simultaneously.

Note: If you're using an SSI for your left navigational links, it's recommended that you use Absolute links and not Relative links. For more information on Relative and Absolute links check out our Relative vs. Absolute Links guide.

Using UMM Templates

How to change your UMM templated page to include SSI

Displaying the last modified date automatically.

There is an SSI command which inserts the document's last modification time. When the server reads a file with this command in, it replaces the command with the appropriate time. The following code puts the document modification time on the page:

Last modified: <!--#echo var="LAST_MODIFIED" -->

Will display: Tuesday, 24-May-2005 09:53:15 CDT
Note: If you are using the UMM Web Templates, the footer contains a Last Modified line.