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
<!--#set var="NAME" value="VALUE" -->
The above example sets the variable NAME to the value VALUE.
<!--#include virtual="FILNAME" -->
This includes an external HTML file at the location of the
The name is virtual (as is seen in web space); in other words
corresponds to the which is found on the web under
Executing cgi commands
<!--#exec cgi="FILNAME" -->
<!--#if expr="EXPRESSION" -->
creates a conditional statement whose execution is controlled by
See Apache's documentation
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
description in the
field. This description is used from time to time in
search engines, etc., as a summary of the page.
||Gives the e-mail address of the person responsible for the web
||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
|The variables indicate which submenus in the gray (higher)
menu should be expanded. If the page is situated under
graymenu_intern is set to some value that menu will be
keywords in the
META field. This
information is used, for example, by search engines
to categorize the the page.
||The name of the person whose is responsible for the page.
||The title of the page as it appears in the document.
||Indicates whether the Datavetenskap header and image with logo
should be displayed. Usually used only on the first page.
||Indicates whether subject bullets should be displayed. Used normally
only on the first page.
||Indicates the title of the page, that title which is shown in
the web browser as the title.
For the document to exist in several languages, there are a number
of issues to consider.
- 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
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.
- Inclusion of templates Standard templates exist for
Swedish and English versions. By default the template
chosen in accordance with the language configuration of
- 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
foot_eng.html in the English-language pages, and
foot_swe.html instead of
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
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
_swe affixed to the base name, as appropriate
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.
Here is a
rendering of this page defined by this code.
<!--#set var="title" value="Institutionen för datavetenskap - Foo" -->|
<!--#set var="pagetitle" value="Bar" -->
<!--#set var="email" value="email@example.com" -->
<!--#set var="namn" value="Nils Holgersson" -->
<!--#include virtual="/include/head.html" -->
<p>A foo is a bar</p>
<!--#include virtual="/include/foot.html" -->