]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FTemplatePlugin
function _PageList_Column* are not private
[SourceForge/phpwiki.git] / pgsrc / Help%2FTemplatePlugin
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;
6   markup=2;
7   charset=UTF-8
8 Content-Transfer-Encoding: binary
9
10 The **Template** [[Help:WikiPlugin|plugin]] allows to include text from a wiki page and replace certain placeholders by parameters.
11
12 A template can be seen as a parametrized block. It is similiar to [[CreatePage]] with the template argument, but at run-time.
13
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.
16
17 == Usage ==
18
19 === Without parameters ===
20
21 Plugin syntax:
22 {{{
23 <<Template page=Footer>>
24 }}}
25
26 Short syntax:
27 {{{
28 {{Footer}}
29 }}}
30
31 === With parameters ===
32
33 Plugin syntax:
34 {{{
35 <<Template page=Film vars="title=SomeFilm&year=1999">>
36 }}}
37
38 Short syntax:
39 {{{
40 {{Film|title=SomeFilm|year=1999}}
41 }}}
42
43 === With a specific revision of the page ===
44
45 Plugin syntax:
46 {{{
47 <<Template page=somepage rev=5>>
48 }}}
49
50 Short syntax:
51 {{{
52 {{somepage?version=5}}
53 }}}
54
55 == Arguments ==
56
57 {| class="bordered"
58 |-
59 ! Argument
60 ! Description
61 ! Default value
62 |-
63 | **page**
64 | pagename to be included as template
65 | //None// (required argument)
66 |-
67 | **vars**
68 | optional parameters to be expanded inside the template
69 | (empty)
70 |-
71 | **rev**
72 | page revision
73 | most recent revision
74 |-
75 | **section**
76 | just include a named section
77 | (empty)
78 |-
79 | **sectionhead**
80 | when including a named section show the heading
81 | (empty)
82 |}
83
84 === Page to include ===
85
86 If "Template:$page" exists, it is used.
87
88 Else, if "Template/$page" exists, it is used.
89
90 Else "$page" is used.
91
92 This allows compatibility with Mediawiki that puts templates in the "Template:" namespace.
93
94 === Parameter expansion ===
95
96 We only support named parameters, not numbered ones as in Mediawiki, and
97 the placeholder is %%var%% and not ~{~{~{var~}~}~} as in Mediawiki.
98
99 {{{
100 vars="var1=value1&var2=value2"
101 }}}
102
103 The following predefined variables are automatically expanded if existing:
104 {| class="bordered"
105 |-
106 ! Variable
107 ! Description
108 |-
109 | pagename
110 |
111 |-
112 | mtime
113 | last modified date + time
114 |-
115 | ctime
116 | creation date + time
117 |-
118 | author
119 | last author
120 |-
121 | owner
122 |
123 |-
124 | creator
125 | first author
126 |-
127 | SERVER_URL
128 |
129 |-
130 | DATA_PATH
131 |
132 |-
133 | SCRIPT_NAME
134 |
135 |-
136 | PHPWIKI_BASE_URL
137 |
138 |-
139 | BASE_URL
140 |
141 |}
142
143 == Inclusion ==
144
145 ~<noinclude> .. ~</noinclude> is stripped.
146
147 ~<includeonly> .. ~</includeonly> is only expanded in pages using the template, not in the template itself.
148
149 <noinclude>
150 ----
151 [[PhpWikiDocumentation]] [[CategoryWikiPlugin]]
152 </noinclude>