1 Date: Fri, 20 Sep 2010 13:46:13 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.4.0RC1)
4 Content-Type: application/x-phpwiki;
5 pagename=Help%2FTemplatePlugin;
6 flags=PAGE_LOCKED%2CEXTERNAL_PAGE;
9 Content-Transfer-Encoding: binary
11 The **Template** [[Help:WikiPlugin|plugin]] 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.
20 === Without parameters ===
24 <<Template page=Footer>>
32 === With parameters ===
36 <<Template page=Film vars="title=SomeFilm&year=1999">>
41 {{Film|title=SomeFilm|year=1999}}
44 === With a specific revision of the page ===
48 <<Template page=somepage rev=5>>
53 {{somepage?version=5}}
65 | pagename to be included as template
69 | optional parameters to be expanded inside the template
74 | most recent revision
77 | page revision (same as ##rev##)
78 | most recent revision
81 | just include a named section
85 | when including a named section show the heading
89 === Page to include ===
91 If "Template:$page" exists, it is used.
93 Else, if "Template/$page" exists, it is used.
97 This allows compatibility with Mediawiki that puts templates in the "Template:" namespace.
99 === Parameter expansion ===
101 We only support named parameters, not numbered ones as in Mediawiki, and
102 the placeholder is %%var%% and not ~{~{~{var~}~}~} as in Mediawiki.
105 vars="var1=value1&var2=value2"
108 The following predefined variables are automatically expanded if existing:
118 | last modified date + time
121 | creation date + time
150 ~<noinclude> .. ~</noinclude> is stripped.
152 ~<includeonly> .. ~</includeonly> is only expanded in pages using the template, not in the template itself.
156 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]