1 Date: Sat, 24 Jan 2009 8:15:24 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124)
4 Content-Type: application/x-phpwiki;
5 pagename=Help%2FTemplatePlugin;
9 Content-Transfer-Encoding: binary
11 The *Template* [plugin|Help:WikiPlugin] allows to include text from a wiki page and replace certain placeholders by parameters.
13 A template can be seen as a parametrized block. It is similiar to [CreatePage] with the template argument, but at run-time.
15 There are two syntaxes to call a template, the usual Phpwiki syntax for plugins, and a more
16 concise syntax similar to Mediawiki templates.
21 <?plugin Template page=Templates/Footer?>
22 <?plugin Template page=Templates/Film vars="title=SomeFilm&year=1999" ?>
23 {{Templates/Film|title=SomeFilm|year=1999}}
26 With a specific revision of the page:
28 <?plugin Template page=somepage rev=5 ?>
29 {{somepage?version=5}}
32 If ENABLE_MARKUP_TEMPLATE is true, we support a Mediawiki-style syntax extension which maps
34 {{TemplateFilm|title=Some Good Film|year=1999}}
38 <?plugin Template page=TemplateFilm vars="title=Some Good Film&year=1999" ?>
50 | pagename to be included as template
54 | optional parameters to be expanded inside the template
59 | most recent revision
62 | just include a named section
66 | when including a named section show the heading
70 !! Parameter expansion
72 vars="var1=value1&var2=value2"
74 We only support named parameters, not numbered ones as in Mediawiki, and
75 the placeholder is %%var%% and not ~{~{~{var~}~}~} as in Mediawiki.
77 The following predefined variables are automatically expanded if existing:
87 | last modified date + time
90 | creation date + time
119 <noinclude> .. </noinclude> is stripped.
121 <includeonly> .. </includeonly> is only expanded in pages using the template, not in the template itself.
127 <?plugin Template page=TemplateExample vars="title=TestTitle" ?>
132 {{TemplateExample|title=TestTitle}}
136 [PhpWikiDocumentation] [CategoryWikiPlugin]