changelog
[git.ikiwiki.info.git] / doc / templates.mdwn
index 58d5d11461f77194036c30b919f61d42a53e2dc3..41542e22c08bd90f49b98dd406a184445377acb0 100644 (file)
@@ -5,12 +5,10 @@ else="This wiki has templates **disabled**."
 ]]
 
 Templates are files that can be filled out and inserted into pages in the
-wiki.
+wiki, using the [[ikiwiki/directive/template]] [[ikiwiki/directive]].
 
 [[!if test="enabled(template) and enabled(inline)" then="""
 
-## Available templates
-
 These templates are available for inclusion onto other pages in this
 wiki:
 
@@ -50,6 +48,9 @@ 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 +63,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 />