HTML/Tcl Templates
A Tcl template works by mixing Tcl code into normal HTML pages.
The server uses the Tcl subst command to replace the Tcl code and
variable references with their results and values.
For example, the version of the Tcl server is:
2.1 12/10/1997
This is obtained with [Httpd_Version] in the page.
The time this page was generated is:
Thu Dec 18 15:03:53 PST 1997
The "location" of this page is Templates.
- Simple Tcl template. If you have a file
that ends with ".subst", then it is processed every time the page is
fetched.
- If you have a ".tml" file then the results of its substitution are
cached in a corresponding ".html" (or ".htm") file. If this cached result
exists, the server returns it directly, which saves the cost of computing
the page. However, if you need the page to be processed every time,
then you should use ".subst" pages.
- The Doc_CheckTemplates command is used to enable template checking for
every .html file in your hierarchy. This way you can have links to
.html files, but have the server check for corresponding .tml template files.
If you want to process query data, it is available in the
page(querylist) variable. This is already decoded into a
list of names and values. Take a look inside form.tml, for example.