SEARCH / BROWSE
BEST PRACTICES
PLANNING PROJECTS
LIBRARY WEBSITE
AUTHOR RESOURCES

Standards/Guidelines
Policies/Procedures
Tools
Tutorials
References
Web Groups
History
Home
ABOUT DPG
library website tools

Server Side Include (SSI)

According to Wikipedia, the primary use for an SSI is to include the contents of one file into another. For example, this can be useful to ensure that the footer information is consistent throughout a website, the current copyright year and current update date are displayed at the bottom of each webpage.

When you want to edit an HTML file that contains an SSI, use unsecure ftp and the odata login to copy the file from the Library Web to your computer.

This tutorial covers three kinds of SSI:

  1. An SSI comment tag that reads in text/mark-up from a file that you've created, and lives in the same directory as the HTML file that calls it.
  2. An SSI comment tag that reads in the date in mm/dd/yy format from the Library Web server.
  3. An SSI comment tag that reads in the year in yyyy format from the Library Web server.

The format of the first kind of SSI comment is:

<!--#include file="filename"-->
  • The file that contains the text/mark-up that you wish to read into an HTML file must use the file extension .ssi.
  • The file that contains the text/mark-up that you wish to read into an HTML file must live in the same directory as the HTML file.

How to create an SSI file

  1. Create the SSI text/mark-up file in a text editor such as Notepad. Type in the text and HTML mark-up that you want to be read into an HTML page.
  2. When you're ready to save the file to your computer, the text editor will force you to add the extension .txt to the file's name.
  3. After you've saved the file, rename it to filename.ssi This renaming process may be done via the file structure on your computer, or via the FTP upload process.

How to add an SSI comment that calls the contents of a file into a webpage

  1. Open your Web authoring tool.
  2. Open the HTML file you want to edit. If you use a WYSIWYG tool such as Dreamweaver, or Netscape Composer, switch to the markup/tag view.
  3. Wherever you want to "read in" text/mark-up from an include file, add an SSI comment tag in the format:
    <!--#include file="filename.ssi"-->
  4. Replace "filename.ssi" will the name of the SSI file you've created. For example, the Bioscience & Natural Resources Library website uses an SSI to read in its copyright/footer information. The BIOS SSI comment tag looks like this:
    <!--#include file="footer.ssi"-->
    The file named footer.ssi lives in the BIOS directory.
  5. Use unsecure FTP to transfer the SSI file and the HTML file into your /pub/incoming/web/ folder. Notify webman@library that the two files are ready for upload into production.
  6. When you need to edit the HTML page that contains an SSI comment tag, use unsecure ftp and the odata login to transfer a copy of the HTML page from the Library Web server onto your computer.
  7. When you need to edit the actual SSI file, you may save it to your computer via unsecure ftp and the odata login, or via your web browser.

How to add an SSI comment that reads in the date in mm/dd/yy format from the Library Web server

  1. Open your Web authoring tool.
  2. Open the HTML file you want to edit. If you use a WYSIWYG tool such as Dreamweaver, or Netscape Composer, switch to the markup/tag view.
  3. Wherever you want to read in the date in mm/dd/yy format from the Library Web server, add these two SSI comment tags:
    <!--#config timefmt="%D"--><!--#echo var="LAST_MODIFIED" -->
  4. You do not need to create an SSI file. The SSI comment tags above read in data from the Library Web server.

How to add an SSI comment that reads in the year in yyyy format from the Library Web server

  1. Open your Web authoring tool.
  2. Open the HTML file you want to edit. If you use a WYSIWYG tool such as Dreamweaver, or Netscape Composer, switch to the markup/tag view.
  3. Wherever you want to read in the year in yyyy format from the Library Web server, add these two SSI comment tags:
    <!--#config timefmt="%Y"--><!--#echo var="LAST_MODIFIED" -->
  4. You do not need to create an SSI file. The SSI comment tags above read in data from the Library Web server.

Contact webman if you have any questions about SSI, or this tutorial.

| UC Berkeley Library Home | Catalogs | Search the Library Website |
Copyright (C) 2007 The Regents of the University of California. All rights reserved.
Document maintained by the Digital Publishing Group.
Last updated 09/09/2007. Server manager: contact