]> sipb.mit.edu Git - ikiwiki.git/blob - doc/ikiwiki/directive/templatebody.mdwn
Record ikiwiki (3.20140916) in archive suite sid
[ikiwiki.git] / doc / ikiwiki / directive / templatebody.mdwn
1 The `templatebody` directive is supplied by the
2 [[!iki plugins/templatebody desc=templatebody]] plugin.
3
4 This directive allows wiki pages to be used as templates
5 for the [[template]] or [[edittemplate]] directive, without having
6 [[!cpan HTML::Template]] markup interpreted as wiki markup when that
7 page is built.
8
9 This directive does not produce any output in the wiki page that
10 defines the template; the rest of that page can be used to to document
11 how to use the template.
12
13 The first, un-named parameter is the content of the template.
14 Because templates often contain [[directives|ikiwiki/directive]], it's
15 convenient to use the "here-document" syntax for it:
16
17         \[[!templatebody <<ENDBODY
18         [[!meta title="<TMPL_VAR name>"]]
19         [[!tag person]]
20         <dl>
21         <dt>Name:</dt><dd><TMPL_VAR name></dd>
22         <dt>Age:</dt><dd><TMPL_VAR age></dd>
23         </dl>
24
25         <TMPL_VAR description>
26         ENDBODY]]
27
28 [[!meta robots="noindex, follow"]]