University of Minnesota Duluth
People | Departments | Search UMD
ITSS
ITSS home : Web Services : WebDev Guide

ITSS WebDev Guide

2 Creating your site : Using virtual includes

Using virtual includes

Virtual includes are another way to provide consistency within a series of pages, as well as make it easier to update the pages. A virtual include is a reference to another html file that is to be "included" when the page is viewed with a browser.

An example of the HTML code for a virtual include is:

<!--#include virtual="/common/html/footer.html"-->

The referenced file ("footer.html") contains the following code:

    <hr>
    The University of Minnesota Duluth is an equal 
    opportunity educator and employer
    <br>
    &copy;2003 University of Minnesota Duluth
    <br>
    Page URL  http://<!--#echo var="server_name"-->
    <!--#echo var="document_URI"-->

By changing the referenced HTML file, all pages with the virtual include are automatically updated.

In the UMD templates, both the header and the footer are set up as virtual includes. This way, if we want to change the information in the footer on each of the UMD pages, we simply change one file (footer.html) and all of the main UMD web pages are automatically updated. All of our ITSS web pages include an additional virtual include for our ITSS header and footer.

Rev: sab 01.05 xs

Didn't find what you were looking for?