From: <var...@us...> - 2008-08-28 18:11:29
|
Revision: 6215 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6215&view=rev Author: vargenau Date: 2008-08-28 18:11:39 +0000 (Thu, 28 Aug 2008) Log Message: ----------- Add description of undocumented arguments Modified Paths: -------------- trunk/pgsrc/Help%2FTemplatePlugin Modified: trunk/pgsrc/Help%FTemplatePlugin =================================================================== --- trunk/pgsrc/Help%2FTemplatePlugin 2008-08-28 18:09:54 UTC (rev 6214) +++ trunk/pgsrc/Help%2FTemplatePlugin 2008-08-28 18:11:39 UTC (rev 6215) @@ -1,4 +1,4 @@ -Date: Sat, 2 Aug 2008 14:15:24 +0000 +Date: Sat, 28 Aug 2008 17:15:24 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -8,85 +8,112 @@ charset=iso-8859-1 Content-Transfer-Encoding: binary -Template = Parametrized blocks. +The *Template* plugin allows to include text from a wiki page and replace certain placeholders by parameters. -Include text from a wiki page and replace certain placeholders by parameters. -Similiar to [CreatePage] with the template argument, but at run-time. -Similiar to the Mediawiki templates but not with the "|" parameter seperator. +A template can be seen as a parametrized block. It is similiar to [CreatePage] with the template argument, but at run-time. -!!! Usage +There are two syntaxes to call a template, the usual Phpwiki syntax for plugins, and a more +concise syntax similar to Mediawiki templates. +!!! Usage + <verbatim> - <?plugin Template page=Templates/Footer?> - <?plugin Template page=Templates/Film vars="title=SomeFilm&year=1999" ?> - {{Templates/Film|title=SomeFilm|year=1999}} +<?plugin Template page=Templates/Footer?> +<?plugin Template page=Templates/Film vars="title=SomeFilm&year=1999" ?> +{{Templates/Film|title=SomeFilm|year=1999}} </verbatim> -If ENABLE_MARKUP_TEMPLATE is true, we support a Mediawiki-style syntax extension which maps +With a specific revision of the page: <verbatim> - {{TemplateFilm|title=Some Good Film|year=1999}} +<?plugin Template page=somepage rev=5 ?> +{{somepage?version=5}} </verbatim> - to + +If ENABLE_MARKUP_TEMPLATE is true, we support a Mediawiki-style syntax extension which maps <verbatim> - <?plugin Template page=TemplateFilm vars="title=Some Good Film&year=1999" ?> +{{TemplateFilm|title=Some Good Film|year=1999}} </verbatim> +to +<verbatim> +<?plugin Template page=TemplateFilm vars="title=Some Good Film&year=1999" ?> +</verbatim> !!! Arguments -Argument| - Default Value| - Description +{| class="bordered" +|- +| Argument +| Description +| Default value +|- +| <b>page</b> +| pagename to be included as template +| (empty) +|- +| <b>vars</b> +| optional parameters to be expanded inside the template +| (empty) +|- +| <b>rev</b> +| page revision +| most recent revision +|- +| <b>section</b> +| just include a named section +| (empty) +|- +| <b>sectionhead</b> +| when including a named section show the heading +| (empty) +|} -page| - (empty)| - pagename to be included as template - -vars| - (empty)| - optional parameters to be expanded inside the template - !! Parameter expansion vars="var1=value1&var2=value2" -We only support named parameters, not numbered ones as in Mediawiki, and +We only support named parameters, not numbered ones as in Mediawiki, and the placeholder is %%var%% and not ~{~{~{var~}~}~} as in Mediawiki. The following predefined variables are automatically expanded if existing: +{| class="bordered" +|- +| Variable +| Description +|- +| pagename +| +|- +| mtime +| last modified date + time +|- +| ctime +| creation date + time +|- +| author +| last author +|- +| owner +| +|- +| creator +| first author +|- +| SERVER_URL +| +|- +| DATA_PATH +| +|- +| SCRIPT_NAME +| +|- +| PHPWIKI_BASE_URL +| +|- +| BASE_URL +| +|} -pagename| - %%% - -mtime| - last modified date + time - -ctime| - creation date + time - -author| - last author - -owner| - %%% - -creator| - first author - -SERVER_URL| - %%% - -DATA_PATH| - %%% - -SCRIPT_NAME| - %%% - -PHPWIKI_BASE_URL| - %%% - -BASE_URL| - %%% - !!! Inclusion <noinclude> .. </noinclude> is stripped. @@ -97,12 +124,12 @@ Standard syntax: <verbatim> - <?plugin Template page=TemplateExample vars="title=TestTitle" ?> +<?plugin Template page=TemplateExample vars="title=TestTitle" ?> </verbatim> Shorter syntax: <verbatim> - {{TemplateExample|title=TestTitle}} +{{TemplateExample|title=TestTitle}} </verbatim> ---- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |