1 Date: Fri, 16 Dec 2011 12:51:22 +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
66 | //None// (required argument)
69 | optional parameters to be expanded inside the template
74 | most recent revision
77 | just include a named section
81 | when including a named section show the heading
85 === Page to include ===
87 If "Template:$page" exists, it is used.
89 Else, if "Template/$page" exists, it is used.
93 This allows compatibility with Mediawiki that puts templates in the "Template:" namespace.
95 === Parameter expansion ===
97 We only support named parameters, not numbered ones as in Mediawiki, and
98 the placeholder is %%var%% and not ~{~{~{var~}~}~} as in Mediawiki.
101 vars="var1=value1&var2=value2"
104 The following predefined variables are automatically expanded if existing:
114 | last modified date + time
117 | creation date + time
146 ~<noinclude> .. ~</noinclude> is stripped.
148 ~<includeonly> .. ~</includeonly> is only expanded in pages using the template, not in the template itself.
152 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]