summaryrefslogtreecommitdiff
path: root/ikiwiki/directive/templatebody.mdwn
blob: 5e4011a2056e6b6efc38556eef9d0d5ca225501c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
[[!if test="enabled(templatebody)"
  then="In diesem Wiki ist die Direktive: templatebody **aktiviert**."
 else="In diesem Wiki ist die Direktive: templatebody **nicht aktiv**. ; falls dies gewünscht wird, den Admin benachrichtigen."]]

---
The `templatebody` directive is supplied by the
[[!iki plugins/templatebody desc=templatebody]] plugin.

This directive allows wiki pages to be used as templates
for the [[template]] or [[edittemplate]] directive, without having
[[!cpan HTML::Template]] markup interpreted as wiki markup when that
page is built.

This directive does not produce any output in the wiki page that
defines the template; the rest of that page can be used to to document
how to use the template.

The first, un-named parameter is the content of the template.
Because templates often contain [[directives|ikiwiki/directive]], it's
convenient to use the "here-document" syntax for it:

	\[[!templatebody <<ENDBODY
	[[!meta title="<TMPL_VAR name>"]]
	[[!tag person]]
	<dl>
	<dt>Name:</dt><dd><TMPL_VAR name></dd>
	<dt>Age:</dt><dd><TMPL_VAR age></dd>
	</dl>

	<TMPL_VAR description>
	ENDBODY]]

[[!meta robots="noindex, follow"]]