|
Templates in UcoZ - special models directing the building of pages of all service modules. These models are ordinary HTML text containing additional template codes which allow to form page contents dynamically, i.e. when some visitor views it. This process depends on some conditions, e.g. module settings, information about current visitor, current date and time etc. Example of simplest template:
Welcome to $SITE_NAME$.
You're
<?if($USERNAME$)?>
user "$USERNAME$"
<?else?>
guest
<?endif?>
In this example $SITE_NAME$ and $USERNAME$ are codes of template variables. First gets value which is specified in account settings as site name. Second gets user login if current visitor is logged in, and empty value otherwise. <?if($USERNAME$)?>, <?else?>, <?endif?> are codes of template conditional blocks. Literally above construction can be read as: if $USERNAME$ variable is non-empty, then process fragment "logged in as user "$USERNAME$"", else process fragment "guest", close conditional block (endif).
Every service module of UcoZ has its own set of templates. For modules containing some materials there are templates for both pages and materials itself, i.e. it's possible to customize not only common appearance of module page but also appearance of each material in the list. Live example is gustbook where materials template determines the appearance of each guestbook entry.
UcoZ users get following means and tools for customizing templates:
- conditional blocks with support of multiple nesting level, string and numerical comparison operators, arithmetical residue of division and bitwise logical "AND"
- global blocks - user set of templates which can be inserted into other templates by special reference
- built-in visual HTML editor (WYSIWYG) for those not familiar with HTML
- quick substitution in templates - tool for substituting some piece of code with another in all or just selected templates
- templates builder - just make corrections into one universal skeleton and rebuild all (or just selected) templates by one click.
|