X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/badd3bc00c4a6e70c009ec9b17ee6d4ef0951e8f..1d650e78108e16052c5e1737421bbe4b13c78b0e:/doc/templates.mdwn?ds=inline diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 5120021a7..41542e22c 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -1,15 +1,14 @@ +[[!meta robots="noindex, follow"]] [[!if test="enabled(template)" then="This wiki has templates **enabled**." 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: @@ -42,14 +41,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 ``. 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: - Name: [[]]
+ Name: \[[]]
Age:
Favorite color: