X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/11334173befbc6ad710b451260ad6f080b326a00..7eafa95f33d4429054d13e6ade54d112c02ba0e1:/doc/templates.mdwn diff --git a/doc/templates.mdwn b/doc/templates.mdwn index acbcd4c8a..0b0a61af2 100644 --- a/doc/templates.mdwn +++ b/doc/templates.mdwn @@ -7,6 +7,9 @@ Templates are files that can be filled out and inserted into pages in the wiki. [[if test="enabled(template) and enabled(inline)" then=""" + +## Available templates + These templates are available for inclusion onto other pages in this wiki: @@ -14,6 +17,8 @@ wiki: sort=title template=titlepage]] """]] +## Using a template + Using a template works like this: \[[template id=note text="""Here is the text to insert into my note."""]] @@ -32,15 +37,16 @@ large chunks of marked up text to be embedded into a template: * Really 8 and a half. """]] +## 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. -The template uses the syntax used by the -[cpan HTML::Template](http://search.cpan.org/search?mode=dist&query=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: +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: * To insert the value of a variable, use ``. * To make a block of text conditional on a variable being set use