home download forum manual awards faq bugs links |
||||||||||
|
TemplatePower manual Arabic Deutsch Dutch English Italian Portuguese (Brazilian) Russian Spanish * Not fully translated yet.
|
TemplateFormatMain template markers/tagsVariables
Like most other template system TemplatePower uses {variablename} as a marker for some value. The variablename must be either a nonnegative integer or a string. However this string may not contain a curly bracket ( { ) or a white space. This means that variablemarkers like {-1}, {a{name} or {a name} are not allowed. In your controllscript you can assign the variable with the function assign(). All variable markers, inside a block, with the same name will be seen as one variable. So, you only have to assign them once. Dynamic blocks
You can use dynamic blocks, for example, when you want to create a table with products with on each row a productnumber, productname and price. Just place the rowcode between the above start/end markers. These markers must be on a separate line each, in order to work properly. The blockname must be either a nonnegative integer or a string. However this string may not contain a dot (.). In your controllscript you can use these blocks with the function newBlock(). Blocks can also be used to hide or show information. If you have defined a block in your template but you don't create it with the function newBlock(), the blockcode will be hidden. This is handy to show/hide errormessages for example. Include blocks
With include blocks you can include files like subtemplates (the templatecode itself, no objects), HTML, etc. However, if you include a PHP-file, the PHP-code will not be executed. Including PHP-files is possible using the includescript block tag, see the TemplatePower v2.0+ template tag section below. This marker must be on a separate line, in order to work properly. The iblockname must be either a nonnegative integer or a string. However this string may not contain a dot (.). In your controllscript you can assign files to iblockname with the function assignInclude(). In TemplatePower v3.0+ it's also possible to create a constant include block.
TemplatePower v2.0+ template tagsIncludescript blocks
With the includescript block tag you can insert a PHP-file, the code will be executed. This marker must be on a separate line, in order to work properly. The iblockname must be either a nonnegative integer or a string. However this string may not contain a dot (.). In your controllscript you can assign files to iblockname with the function assignInclude(). Like with the include block tag, it's also possible to create a constant includescript block. This feature is supported by TemplatePower v3.0 or higher.
Ignore block
If you place any code between the start/end ignore tag, this code will just be parsed as code. This means that no variable or block will be processed in this code. These markers must be on a separate line each, in order to work properly. ReUse block
With the reuse tag you can reuse an other block and give it a different blockname. This feature is not totally bug-proof. The reuse tag will only work properly when the block you want to reuse has no child block(s). The copyblockname must be either a nonnegative integer or a string. However this string may not contain a dot (.). Database templatesDatabase Templates have to be stored in the same format as normal templates. So, the Carriage Return (cr) and Line Feed (lf) must be stored in the database as well. |
|||||||||
|
CopyRights © 2001-2009 Ron. P.J. Velzeboer. |