1 Date: Fri, 16 Dec 2011 12:51:22 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0)
3 Content-Type: application/x-phpwiki;
4 pagename=Help%2FTemplatePlugin;
5 flags=PAGE_LOCKED%2CEXTERNAL_PAGE;
8 Content-Transfer-Encoding: binary
10 The **Template** [[Help:WikiPlugin|plugin]] allows to include text from a wiki page and replace certain placeholders by parameters.
12 A template can be seen as a parametrized block. It is similiar to [[CreatePage]] with the template argument, but at run-time.
14 There are two syntaxes to call a template, the usual Phpwiki syntax for plugins, and a more
15 concise syntax similar to Mediawiki templates.
19 === Without parameters ===
23 <<Template page=Footer>>
31 === With parameters ===
35 <<Template page=Film vars="title=SomeFilm&year=1999">>
40 {{Film|title=SomeFilm|year=1999}}
43 === With a specific revision of the page ===
47 <<Template page=somepage rev=5>>
52 {{somepage?version=5}}
64 | pagename to be included as template
65 | //None// (required argument)
68 | optional parameters to be expanded inside the template
73 | most recent revision
76 | just include a named section
80 | when including a named section show the heading
84 === Page to include ===
86 If "Template:$page" exists, it is used.
88 Else, if "Template/$page" exists, it is used.
92 This allows compatibility with Mediawiki that puts templates in the "Template:" namespace.
94 === Parameter expansion ===
96 We only support named parameters, not numbered ones as in Mediawiki, and
97 the placeholder is %%var%% and not ~{~{~{var~}~}~} as in Mediawiki.
100 vars="var1=value1&var2=value2"
103 The following predefined variables are automatically expanded if existing:
113 | last modified date + time
116 | creation date + time
145 ~<noinclude> .. ~</noinclude> is stripped.
147 ~<includeonly> .. ~</includeonly> is only expanded in pages using the template, not in the template itself.
151 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]