X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/f92505d78b82c6ac146e43054ebd12441575a602..a0636fd5f89679c811356e38881cfe2f5a8904f7:/doc/templates.mdwn diff --git a/doc/templates.mdwn b/doc/templates.mdwn index 24da881c7..6b237bd9e 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -1,3 +1,4 @@ +[[!meta robots="noindex, follow"]] [[!if test="enabled(template)" then="This wiki has templates **enabled**." else="This wiki has templates **disabled**." @@ -8,8 +9,6 @@ wiki. [[!if test="enabled(template) and enabled(inline)" then=""" -## Available templates - These templates are available for inclusion onto other pages in this wiki: @@ -39,15 +38,19 @@ large chunks of marked up text to be embedded into a template: ## Creating a template -To create a template, simply add a template directive to a page, and page will -provide a link that can be used to create the template. The template is a -regular wiki page, located in the `templates/` directory. +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. 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 @@ -60,7 +63,7 @@ few things: Here's a sample template: - Name: [[]]
+ Name: \[[]]
Age:
Favorite color: