A template is the general term used to describe a file that holds layout elements for a module, block or theme. The templates consist of some markup which is mostly, but not exclusively (x)html, and some template tags. Template tags are used to insert the dynamic elements into the markup.
All template tags are represented using the following delimiters:
<!--[ and ]-->
This allows the tags to be handled easily using any html authoring software since the following are an html comment:
<!-- and -->
Two principal types of template tag exist. The first, a template variable, is used place a specific piece of output into a template. Template variables are represented as
<!--[$mytemplatevariable]-->
A template variable can be anything from the very simple (e.g. the number of comments available on an article) to the more complex built from other templates (e.g. the ‘maincontent’ variable used in themes which holds the output from the current module).
To see what template variables are available in a specific template temporarily add the function plugin tag:
<!--[pndebug]-->
Addition of this tag will trigger a popup window listing what template variables are available to the current template.
The second type of template tag is the function plugin often simply referred to as a pluin although there are other plugin types available. Unlike the template varaible a function plugin tag is not a specific piece of output but triggers the execution of small piece of php code. A function plugin can serve almost any purpose. A plugin tag is represented as
<!--[myplugin]-->
(note the lack of ‘$’).
While not strictly a template tag another common plugin type is the variable modifier. A variable modifer, as the name suggests, modifies the contents of a template variable. Modifiers can be used for many purposes e.g. text transform filters (textile, bbcode), proper capitalisation. A variable modifier is represented inside a template variable tag using ‘|myvariablemodifier’ e.g.
<!--[$mytemplatevariable|myvariablemodifier]-->