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:
3.4.2 September 3, 2002
This is obtained with [Httpd_Version] in the page.
The time this page was generated is:
Wed Sep 03 00:03:34 GMT Standard Time 2003
- FAQ Generator example that illustrates
how to use
the faq module in the sample libtml directory.
- 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 via the ncgi
interface, and indirectly via the html interface used
to create form elements.