Using KML KML stands for Kore Mark-Up Language. It's used to perform dynamic functions and retrieve data. KML is designated as such by the use of tags: '[$' and '$]' are the opening and closing tags for KML, respectively.
[$ kml here $]KML is surrounded by the tags, this can be nested within any number of html tags, or at any position within a html document, not limited to the examples below:
<html [$ kml here $]> <div id="[$ kml here $]"> [$ kml here $] </div> </html> [$ kml here $]In KML, curly brackets always define a variable, {var}. Normal parenthesis always define strings (string).
You can nest a variable within a string by using the curly brackets. (string {var}).
You can escape {} and () characters as well, by using the universal escape character: '\'. (string \(parenthesis\) \{ curly brackets \} )
Comments Comments are used to make code more readable. Comment out the rest of a line by using two consecutive / characters.
[$ // Comment $]
[$
// Note that print or prnt can be used.
print {variable}
// or
print (string)
// or
print (string {variable} )
$]
A maximum of two trailing spaces between after the opening parenthesis and before the closing parenthesis are trimmed. To include a space at the beginning of your string, use three spaces after the opening parenthesis, etc.
Set The set function is used to set or modify the values of variables
[$
// Note that trailing space trimming protocols are the same for SET as in PRNT.
set {variablename} (string)
// or
set {variablename} (string {anothervariable})
$]
Cycle is a powerful function that will perform an action for every child associated with your template. This function does not have to be within KML tags, and can have KML and HTML tags nested inside itself.
<$ start cycle (parameter) $>
[$ prnt {childname} $]
<br />
<$ end cycle $>
>>>>>>>> Prints every child's name, one after the other.
Parameters control the order of results from Cycle. Available parameters are as follows:
default first >>>>>>>> Default child is first. default last >>>>>>>> Default child is last childname asc >>>>>>>> Childname sorted A-Z childname desc >>>>>>>> Childname sorted Z-A title asc >>>>>>>> Title sorted A-Z title desc >>>>>>>> Title sorted Z-A created asc >>>>>>>> The date child was created, oldest to newest created desc >>>>>>>> The date child was created, newest to oldest modified asc >>>>>>>> Last modified date, oldest to newest modified desc >>>>>>>> Last modified date, newest to oldest.
{content}
{title}
{childname}
{templatetitle}
{sitetitle}
{sitename}
{siteurl}
{thispageurl}
{templatename}
{lastpublished}