]> sipb.mit.edu Git - ikiwiki.git/blobdiff - doc/templates.mdwn
response
[ikiwiki.git] / doc / templates.mdwn
index 5120021a79e055717f5f31c011ccb2bb483bf6b4..1c234e3b5c38c46b0d4045d41c13ead8669353db 100644 (file)
@@ -1,3 +1,4 @@
+[[!meta robots="noindex, follow"]]
 [[!if test="enabled(template)"
 then="This wiki has templates **enabled**."
 else="This wiki has templates **disabled**."
@@ -42,14 +43,16 @@ large chunks of marked up text to be embedded into a template:
 To create a template, simply add a template directive to a page, and the 
 page will provide a link that can be used to create the template. The template
 is a regular wiki page, located in the `templates/` subdirectory inside
-the source directory of the wiki. (Not to be confused with the
-[[wikitemplates]] which are stored in a different location.)
+the source directory of the wiki.
 
 The template uses the syntax used by the [[!cpan HTML::Template]] perl
 module, which allows for some fairly complex things to be done. Consult its
 documentation for the full syntax, but all you really need to know are a
 few things:
 
+* Each parameter you pass to the template directive will generate a 
+  template variable. There are also some pre-defined variables like PAGE
+  and BASENAME.
 * To insert the value of a variable, use `<TMPL_VAR variable>`. Wiki markup
   in the value will first be converted to html.
 * To insert the raw value of a variable, with wiki markup not yet converted
@@ -62,7 +65,7 @@ few things:
 Here's a sample template:
 
         <span class="infobox">
-        Name: [[<TMPL_VAR raw_name>]]<br />
+        Name: \[[<TMPL_VAR raw_name>]]<br />
         Age: <TMPL_VAR age><br />
         <TMPL_IF NAME="color">
         Favorite color: <TMPL_VAR color><br />