Our web site uses 2 server side inserts (SSI): header.txt and link.txt. As the names suggest, these are not HTML files, but rather ordinary text files (like a stripped-down MS Word document). The text in each of the boxes below is all the text in either of the two files - there is no <HEAD> or <HTML> or <BODY>. This is because SSIs don't stand on their own. As the name suggests, they are inserted into other documents.
The first document (header.txt) contains only an link to an image. (Technically, this document could have been omitted, but I didn't realize that until rather far into the process.) Header.txt is inserted at the top of the page, and provides the heading. The <DIV> into which it is inserted formats it and determines its margins.
|
<IMG SRC="header3.gif"> |
The second file is the link.txt. It looks intimidating only because it happens to contain the information that makes the sidebar, which is an image map generated in Adobe ImageReady, work.
|
<!-- ImageReady Slices (Untitled-1) --> <IMG SRC="base.gif" WIDTH=150 HEIGHT=900 BORDER=0 USEMAP="#base_Map"> <MAP NAME="base_Map"> <AREA SHAPE="rect" ALT="?" COORDS="0,841,150,900" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/clothes.shtml"> <AREA SHAPE="rect" ALT="leisure" COORDS="0,799,150,841" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/leisure.shtml"> <AREA SHAPE="rect" ALT="art" COORDS="0,763,150,800" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/art.shtml"> <AREA SHAPE="rect" ALT="travel" COORDS="0,721,150,764" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/travel.shtml"> <AREA SHAPE="rect" ALT="medicine" COORDS="0,682,150,721" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/medicine.shtml"> <AREA SHAPE="rect" ALT="law" COORDS="0,640,150,682" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/law.shtml"> <AREA SHAPE="rect" ALT="protestantism" COORDS="0,601,150,641" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/protestantism.shtml"> <AREA SHAPE="rect" ALT="spousal abuse" COORDS="0,562,150,601" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/spousal_abuse.shtml"> <AREA SHAPE="rect" ALT="domesticity" COORDS="0,520,150,563" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/domesticity.shtml"> <AREA SHAPE="rect" ALT="motherhood" COORDS="0,481,150,521" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/motherhood.shtml"> <AREA SHAPE="rect" ALT="marriage" COORDS="0,439,149,481" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/marriage.shtml"> <AREA SHAPE="rect" ALT="men" COORDS="0,403,150,440" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/men.shtml"> <AREA SHAPE="rect" ALT="women in entertainment" COORDS="0,337,150,403" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/wentertainment.shtml"> <AREA SHAPE="rect" ALT="sex work" COORDS="0,298,150,337" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/sex_work.shtml"> <AREA SHAPE="rect" ALT="birth control" COORDS="0,256,149,298" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/birth_control.shtml"> <AREA SHAPE="rect" ALT="sexuality" COORDS="0,217,150,257" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/sexuality.shtml"> <AREA SHAPE="rect" ALT="self-image" COORDS="0,177,150,218" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/self_image.shmtl"> <AREA SHAPE="rect" ALT="sports" COORDS="0,136,150,178" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/sports.shtml"> <AREA SHAPE="rect" ALT="education" COORDS="0,94,150,136" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/education.shtml"> <AREA SHAPE="rect" ALT="girlhoood" COORDS="0,52,150,95" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/girlhood.shtml"> <AREA SHAPE="rect" ALT="Home" COORDS="0,0,150,52" HREF="http://www.cwrl.utexas.edu/~ulrich/femhist/index.shtml"> </MAP> <!-- End ImageReady Slices --> |
However, SSIs often contain perfectly ordinary HTML or text. They might contain a disclaimer paragraph, for example, that a corporation posts on every page of its website, or a list of important email addresses posted on multiple pages. Most commonly, of course, they contain navigation elements, like our sidebar. The beauty of SSIs is that you only have to type something once which will then appear on as many pages as you like.
Ask with Cascading Style Sheets, SSIs are inserted into pages by the inclusion of a link. The sidebar, for example, is called up by this code:
<!--#include virtual="link.txt" -->
The other crucial element of SSIs is that you must be using a server that supports that function, and you must use the .shtml suffix on the filename of the document into which the SSI is being inserted.
Because SSIs function at the server level, your files must be uploaded to the server before you will be able to tell if your files are working properly.
Back to How to Code
This page was written by Melanie Ulrich, and is maintained by Melanie Ulrich.
This page was last updated Saturday, 18-May-2002 08:28:12 CDT