Computer Laboratories
Computer systems
    Computer Lab Bookings
    Computer Laboratories
    Disk storage
    Machine status
    User accounts
    Web pages
Contact us
Introduction to Systems

The web structure of the department

This information is directed to employees who intend to create web pages according to the model of the department.


To create a web structure which is easy to maintain, build each page using so-called Server Side Includes, SSI. Observe that a number of variables are set to control the way the appearance and then a pair of standard pages are included.

A short introduction to SSI

Apache's introduction to SSI is found here

The core of SSI is a language which is embedded in HTML comments; the statements are of the general form <!--#CMD EXPR="VALUE"-->

Setting variables

<!--#set var="NAME" value="VALUE" -->

The above example sets the variable NAME to the value VALUE.

Including files

<!--#include virtual="FILNAME" -->

This includes an external HTML file at the location of the directive. The name is virtual (as is seen in web space); in other words /include/head.html corresponds to the which is found on the web under http://www.cs.umu.se/include/head.html.

Executing cgi commands

<!--#exec cgi="FILNAME" -->

Conditional statements

<!--#if expr="EXPRESSION" -->
<!--#elseif -->
<!--#else -->

creates a conditional statement whose execution is controlled by EXPRESSION.

See Apache's documentation mod_include for more information on valid expressions and built-in variables.


These are the variables which are used in standard patterns. All file names in the table indicate the base name of the file and are relative to /include.

Variable File Description
description head.html Sets description in the META field. This description is used from time to time in search engines, etc., as a summary of the page.
email foot.html (footer.html) Gives the e-mail address of the person responsible for the web page.
extra_css head.html If it is desired to use CSS (Cascading Style Sheets), it is necessary to use the style patterns in <head>. Set this variable to the name of the file which contains the patterns and should be included. Remember that the search path is relative to /include.
The variables indicate which submenus in the gray (higher) menu should be expanded. If the page is situated under https//www.cs.umu.se/intern/, if graymenu_intern is set to some value that menu will be expanded.
keywords head.html Sets the keywords in the META field. This information is used, for example, by search engines to categorize the the page.
namn foot.html (footer.html) The name of the person whose is responsible for the page.
pagetitle head.html The title of the page as it appears in the document.
showcsheader head.html Indicates whether the Datavetenskap header and image with logo should be displayed. Usually used only on the first page.
showbullets head.html Indicates whether subject bullets should be displayed. Used normally only on the first page.
title head.html Indicates the title of the page, that title which is shown in the web browser as the title.

Multi-lingual pages

For the document to exist in several languages, there are a number of issues to consider.

  1. File naming To have the web browser choose the language of presentation automatically (according to configuration in the browser), files with suffixes are used; for example, index.html.en for English or index.html.sv for Swedish. For a more complete list of languages and suffixes, see the language configurations of the browser.
  2. Inclusion of templates Standard templates exist for Swedish and English versions. By default the template chosen in accordance with the language configuration of the browser.
  3. In English To enable the "In English" function in the the navigation menu to the right, it is necessary to take a few steps. First, the files head_eng.html, foot_eng.html in the English-language pages, and head_swe.html and foot_swe.html instead of the usual head.html and foot.html. This is necessary to have a consistent language over the whole page regardless of the browser settings. (Make sure that they are symbolic links and that furthermore .html.en and .html.sv exist, so that automatic language selection works.) Second, create two extra symbolic links from the English page variant (e.g., foo.html.en) to one with _eng or _swe affixed to the base name, as appropriate (e.g.,foo_eng.html).

Creating a simple web page

The example below can be seen as a simple pattern for creating normal pages. That which must be added is the expansion of the correct submenus, dependent upon where in the structure the file is located.

The following is skeleton code from a page with the title "Foo:", subtitle "Bar", and "Nils Holgersson <nisse>" responsible for the page.

<!--#set var="title" value="Institutionen för datavetenskap - Foo" -->
<!--#set var="pagetitle" value="Bar" -->
<!--#set var="email" value="nisse@cs.umu.se" -->
<!--#set var="namn" value="Nils Holgersson" -->
<!--#include virtual="/include/head.html" -->
<p>A foo is a bar</p>
<!--#include virtual="/include/foot.html" -->
Here is a rendering of this page defined by this code.

Questions or problems? Send mail to: support@cs.umu.se