Table of contents ▼▲
Templates
This wiki delivers its contents via a powerful template system.All template fields are identified by surrounding the field in the format
<!--{ }-->. By using this format the template fields are less intrusive to the HTML as this is a valid HTML comment.
Available Fields
-
<!--{$<var>}-->- Simply show the contents of an associative array variable. Initially this will be$TPParms[<var>]. On calls to FOREACH the parent array changes. -
<!--{IFDEF $<var>}-->- If the variable exists and contains data, then the conditional block will be included. ''Can be used recursively'' -
<!--{IFNDEF $<var>}-->- If the variable does not exists or contains no data, then the conditional block will be included. ''Can be used recursively'' -
<!--{ENDIF}-->- Must end an IFDEF or IFNDEF check. -
<!--{INCLUDE <file>}-->- Expand the current template with the contents of another file. -
<!--{FOREACH <var>}-->- -
<!--{CALL <func>}-->- calls and runs a php function. The output from the function will be placed into the output buffer. -
<!--{<func>}-->- Same as above, but without the optional CALL keyword
''Note:''At the moment IF... and ENDIF commands need to be seperate lines.
<!--{IF $var}-->
some text....
<!--{ENDIF{-->
An example of a template file.
This is the diff display template and is a good example of '''foreach''' and '''if''' processing.
<!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">
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<link rel="stylesheet" type="text/css" href="<!--{$CSS_URL}-->"/>
<title>::<!--{$NAME}--> [Diff] <!--{$GROUP}-->/<!--{$SUBGROUP}-->/<!--{$PAGENAME}-->::</title>
</head>
<body>
<div class='divWikidHdr'>
<a href="<!--{$SCRIPT_NAME}-->"><img src="img/smileys/house.gif" border='0' alt='wikid-x home' /></a>
<br />Page revisions...
</div>
<div class='divWikidBody'>
<!--{FOREACH $DIFF_TEXT}-->
<div class="divWikidDiffDate">
<!--{$DATE}-->
[ <a href="<!--{$SCRIPT_NAME}-->?page=/<!--{$GROUP}-->/<!--{$SUBGROUP}-->/<!--{$PAGENAME}-->&amp;action=revert&amp;ver=<!--{$DATE_RAW}-->" >Revert...</a> ]
<!--{FOREACH $ROW}-->
<div class="divWikidDiffRow">
<!--{$TYPE}-->
<!--{IFDEF $OLD}-->
<table>
<tr>
<td class="divWikidDiffOld">&nbsp;</td>
<td><!--{$OLD}--></td>
</tr>
</table>
<!--{ENDIF}-->
<!--{IFDEF $NEW}-->
<table>
<tr>
<td class="divWikidDiffNew">&nbsp;</td>
<td><!--{$NEW}--></td>
</tr>
</table>
<!--{ENDIF}-->
</div>
<!--{ENDFOREACH}-->
</div>
<!--{ENDFOREACH}-->
</div>
<div class='divWikidFtr'>
..:: Powered by <a href='<!--{$WIKIURL}-->' ><!--{$NAME}-->:<!--{$VERSION}--></a> ::..
</div>
</body>
</html>