Go to the first, previous, next, last section, table of contents.
The template files are the HTML files used by the cgi-bin to interact with the user. Every interaction step is associated with the file name of a template, the content of this file is read and analyzed by the cgi-bin and portions of it are replaced according to the action taken.
The simplest of all templates is the error template. It looks like this:
<title>Error</title> <center><h3> Error<p> _MESSAGE_ </center></h3>
When an error occurs in a cgi-bin the error template is used. The _MESSAGE_ tag is replaced by the actual error message and the result is sent to the user.
The templates file names are located in the current directory if the
TEMPLATESDIR
environment variable is not set. If it is set it
must contain a list of colon separated directories. The directories are
explored in order to find the template file. If no file is found a default
in-core version is used.
A template is often divided is parts, sometimes recursively. The general syntax of this subdivision is as follows:
bla bla... <!-- start part --> bla bla... <!-- start subpart --> bla bla... <!-- end subpart --> bla bla... <!-- end part --> bla bla...
The template contains a part named part
. This part contains a
subpart named subpart
. This kind of subdivision is used when
a component of the template must be repeated or conditionally included.
Note that the specifications for parts are included in HTML comments
to prevent interferences when editing the template with a wysiwyg editor.
Within a part, it is possible to specify arbitrary parameters to the cgi-bin
using the params
specification.
<!-- params 'var1' => 'value1', 'var2' => 'value2'... -->
The exact variables allowed in such an instruction and the interpretation of their values depend on the cgi-bin.
The tags of a template are strings that will be replaced by actual values by the cgi-bin. The tags are always surrounded by underscores and the strings are in upper case. If two strings appear in the same tag they are separated by a dash (-). These are valid tags:
These are not valid tags:
The tags found in a part or subpart of a template may be the same, this does not mean that they will be replaced by the same string. All the parts and subparts have a separate name space. Always refer to the template documentation to find out which tags are defined.
The exact semantic associated to these subdivisions completely depends on the action associated to the template.
Go to the first, previous, next, last section, table of contents.