]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FTemplatePlugin
Reorder documentation
[SourceForge/phpwiki.git] / pgsrc / Help%2FTemplatePlugin
1 Date: Sat, 2 Aug 2008 14:15:24 +0000
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124)
3 X-Rcs-Id: $Id: Help%2FTemplatePlugin,v 1.4 2008-08-03 16:46:12 vargenau Exp $
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FTemplatePlugin;
6   flags=PAGE_LOCKED;
7   markup=2;
8   charset=iso-8859-1
9 Content-Transfer-Encoding: binary
10
11 Template = Parametrized blocks.
12
13 Include text from a wiki page and replace certain placeholders by parameters.
14 Similiar to [CreatePage] with the template argument, but at run-time.
15 Similiar to the Mediawiki templates but not with the "|" parameter seperator.
16
17 !!!  Usage
18
19 <verbatim>
20   <?plugin Template page=Templates/Footer?>
21   <?plugin Template page=Templates/Film vars="title=SomeFilm&year=1999" ?>
22   {{Templates/Film|title=SomeFilm|year=1999}}
23 </verbatim>
24
25 If ENABLE_MARKUP_TEMPLATE is true, we support a Mediawiki-style syntax extension which maps 
26 <verbatim>
27     {{TemplateFilm|title=Some Good Film|year=1999}}
28 </verbatim>
29   to 
30 <verbatim>
31     <?plugin Template page=TemplateFilm vars="title=Some Good Film&year=1999" ?>
32 </verbatim>
33
34 !!! Arguments
35
36 Argument|
37   Default Value|
38     Description
39
40 page|
41   (empty)|
42     pagename to be included as template
43
44 vars|
45   (empty)|
46     optional parameters to be expanded inside the template
47
48 !! Parameter expansion
49
50   vars="var1=value1&var2=value2"
51
52 We only support named parameters, not numbered ones as in Mediawiki, and 
53 the placeholder is %%var%% and not ~{~{~{var~}~}~} as in Mediawiki.
54
55 The following predefined variables are automatically expanded if existing:
56
57 pagename|
58   %%%
59
60 mtime|
61   last modified date + time
62
63 ctime|
64   creation date + time
65
66 author|
67   last author
68
69 owner|
70   %%%
71
72 creator|
73   first author
74
75 SERVER_URL|
76   %%%
77
78 DATA_PATH|
79   %%%
80
81 SCRIPT_NAME|
82   %%%
83
84 PHPWIKI_BASE_URL|
85   %%%
86
87 BASE_URL|
88   %%%
89
90 !!! Inclusion
91
92 <noinclude> .. </noinclude> is stripped.
93
94 <includeonly> .. </includeonly> is only expanded in pages using the template, not in the template itself.
95
96 !!! Examples
97
98 Standard syntax:
99 <verbatim>
100   <?plugin Template page=TemplateExample vars="title=TestTitle" ?>
101 </verbatim>
102
103 Shorter syntax:
104 <verbatim>
105   {{TemplateExample|title=TestTitle}}
106 </verbatim>
107
108 ----
109 [PhpWikiDocumentation] [CategoryWikiPlugin]