]> CyberLeo.Net >> Repos - SourceForge/phpwiki.git/blob - pgsrc/Help%2FTemplatePlugin
major pgsrc restructuring: internal doc into Help/*
[SourceForge/phpwiki.git] / pgsrc / Help%2FTemplatePlugin
1 Date: Sat, 10 Sep 2005 21:42:11 +0100
2 Mime-Version: 1.0 (Produced by PhpWiki 1.3.11)
3 X-Rcs-Id: $Id: Help%2FTemplatePlugin,v 1.1 2005-11-21 22:19:00 rurban Exp $
4 Content-Type: application/x-phpwiki;
5   pagename=Help%2FTemplatePlugin;
6   pgsrc_version="1 $Revision: 1.1 $";
7   flags="";
8   markup=2;
9   charset=iso-8859-1
10 Content-Transfer-Encoding: binary
11
12 !! Synopsis
13
14 Template = Parametrized blocks.
15
16 Include text from a wiki page and replace certain placeholders by parameters.
17 Similiar to CreatePage with the template argument, but at run-time.
18 Similiar to the mediawiki templates but not with the "|" parameter seperator.
19
20 !!  Usage
21 <verbatim>
22   <?plugin Template page=Templates/Footer?>
23   <?plugin Template page=Templates/Film vars="title=SomeFilm&year=1999" ?>
24   {{Templates/Film|title=SomeFilm|year=1999}}
25 </verbatim>
26
27 !! Plugin Arguments
28 Argument|
29   Default Value|
30     Description
31
32 page|
33   (empty)|
34     pagename to be included as template
35
36 vars|
37   (empty)|
38     optional parameters to be expanded inside the template
39
40 ! Parameter expansion:
41   vars="var1=value1&var2=value2"
42
43 We only support named parameters, not numbered ones as in mediawiki, and 
44 the placeholder is %%var%% and not {{~{var~}}} as in mediawiki.
45
46 The following predefined variables are automatically expanded if existing:
47 <verbatim>
48   pagename
49   mtime     - last modified date + time
50   ctime     - creation date + time
51   author    - last author
52   owner     
53   creator   - first author
54   SERVER_URL, DATA_PATH, SCRIPT_NAME, PHPWIKI_BASE_URL and BASE_URL
55 </verbatim>
56
57 <noinclude> .. </noinclude> is stripped
58
59 ! In work:
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 Help:WikiPlugin