Template in this system is an html (or xhtml, or whatever (must be text)) document with special tags, that instruct the system what to do (eg. write/remove text at some spot, check a condition, etc.).
The location/name of the template file is specified in configuration. This is how a simple xhtml template looks like (if you download this CMS, you'll find the template of this website):
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-type" content="text/html; charset=UTF-8" /> <title><val MAIN_TITLE></title> </head> <body> <h1><val MAIN_TITLE></h1> <hr /> <for AR in ARTICLES> <div> <h2><val AR.title></h2> <val AR.body> </div> </for> </body> </html>
Template is processed in the same order as it is given in above list i.e. when processing, for example, if statements, val statements will already be processed and so on.
It is case sensitive.
The depth of loops inside of loops inside of loops, ifs inside of ifs and other things is unlimited.
Variable names must contain only uppercase and lowercase letters, numbers and _ symbols. Indexes of arrays and structures are seperated with dots. There are three types of variables:
Apart from variables gathered from content, there are some defined by system:
|LANG||text||Indicates current language code (in this case LANG = '
|LANGS||array||contains text variables that contain codes of
all languages the site is available in (in this case LANGS =
|PAGE||structure||contains variables of various types which contain the information about the current page. In this case:
|PAGES||array||contains structures of type PAGE that contain information about root pages of the site.|
|PATH||array||contains structures of type PAGE that contain information about pages that are in the current path from the root page to the current one.|
|ENCODING||text||encoding used in the site (specified in the configuration; in this case ENCODING = '
|POWERED||text||contains a link to the homepage of this CMS, title and version (look at the bottom of this page). You can put this link on your websites if you wish :-)|