]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FTemplatePlugin
Harmonize documentation
[SourceForge/phpwiki.git] / pgsrc / Help%2FTemplatePlugin
1 Date: Mon, 16 Jun 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.3 2008-06-18 01:12:39 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 !!! Arguments
26
27 Argument|
28   Default Value|
29     Description
30
31 page|
32   (empty)|
33     pagename to be included as template
34
35 vars|
36   (empty)|
37     optional parameters to be expanded inside the template
38
39 !! Parameter expansion:
40   vars="var1=value1&var2=value2"
41
42 We only support named parameters, not numbered ones as in mediawiki, and 
43 the placeholder is %%var%% and not {{~{var~}}} as in mediawiki.
44
45 The following predefined variables are automatically expanded if existing:
46 <verbatim>
47   pagename
48   mtime     - last modified date + time
49   ctime     - creation date + time
50   author    - last author
51   owner     
52   creator   - first author
53   SERVER_URL, DATA_PATH, SCRIPT_NAME, PHPWIKI_BASE_URL and BASE_URL
54 </verbatim>
55
56 <noinclude> .. </noinclude> is stripped
57
58 !! In work
59
60 * ENABLE_MARKUP_TEMPLATE = true: (lib/InlineParser.php)
61   Support a Mediawiki-style syntax extension which maps 
62 <verbatim>
63     {{TemplateFilm|title=Some Good Film|year=1999}}
64 </verbatim>
65   to 
66 <verbatim>
67     <?plugin Template page=TemplateFilm vars="title=Some Good Film&year=1999" ?>
68 </verbatim>
69
70 !!! Examples
71
72 <verbatim>
73   <?plugin Template page=TemplateExample vars="title=TestTitle" ?>
74 </verbatim>
75
76 Standard syntax:
77   <?plugin Template page=TemplateExample vars="title=TestTitle" ?>
78
79 Shorter syntax:
80   {{TemplateExample|title=TestTitle}}
81
82 ----
83 [PhpWikiDocumentation] [CategoryWikiPlugin]