I use HTML::Template for creating the presentation files
from the config and sheet data and from the templates in the
templates directory.
I only use a few basic features of HTML::Template.
I could have taken Template::Toolkit instead, but HTML::Template
was already installed on the computer where I started to program
SPIP and Template::Toolkit was not, so I took HTML::Template.
This are the features I use (there are more, see perldoc
HTML::Toolkit):
-
Inserting content:
<TMPL_VAR NAME="VARNAME">.
Here the value to the key VARNAME in the
parameter hash of HTML::Template will be inserted
into the created document.
-
Test if a variable (key) exists:
<TMPL_IF NAME="VARNAME">
...
</TMPL_IF>
All things between the two statements is only analyzed and
inserted if the variable VARNAME exists.
(That means if the key VARNAME exists in the
parameter hash of HTML::Template.)
-
Including other template files and analyze them:
<TMPL_INCLUDE NAME="spip_head.tmpl">
Copyright
Christian Dühl
February 2005