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.1 12/24/1997
This is obtained with [Httpd_Version] in the page.
The time this page was generated is:
Wed Jan 28 15:26:01 PST 1998
- Simple Tcl template. If you have a file
that ends with ".subst", then it is processed every time the page is
fetched.
- A ".tml" file can be used just like .subst in that if you ask for
"page.tml" it will be processed.
However, if the link is instead to "page.html", then the .html version
is only generated if the corresponding .tml file is newer, or if
any of the .tml files in the directory tree above the file are newer.
The results of processing the .tml are cached in the .html file.
- 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.