From: <var...@us...> - 2009-03-20 14:34:52
|
Revision: 6678 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6678&view=rev Author: vargenau Date: 2009-03-20 14:34:43 +0000 (Fri, 20 Mar 2009) Log Message: ----------- Better examples Modified Paths: -------------- trunk/pgsrc/Help%2FTemplatePlugin Modified: trunk/pgsrc/Help%FTemplatePlugin =================================================================== --- trunk/pgsrc/Help%2FTemplatePlugin 2009-03-20 09:12:44 UTC (rev 6677) +++ trunk/pgsrc/Help%2FTemplatePlugin 2009-03-20 14:34:43 UTC (rev 6678) @@ -1,4 +1,4 @@ -Date: Fri, 6 Mar 2009 09:48:31 +0000 +Date: Fri, 20 Mar 2009 15:30:03 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -10,34 +10,49 @@ The **Template** [[Help:WikiPlugin|plugin]] allows to include text from a wiki page and replace certain placeholders by parameters. -A template can be seen as a parametrized block. It is similiar to [CreatePage] with the template argument, but at run-time. +A template can be seen as a parametrized block. It is similiar to [[CreatePage]] with the template argument, but at run-time. There are two syntaxes to call a template, the usual Phpwiki syntax for plugins, and a more concise syntax similar to Mediawiki templates. == Usage +=== Without parameters + +Plugin syntax: {{{ -<<Template page=Templates/Footer>> -<<Template page=Templates/Film vars="title=SomeFilm&year=1999">> -{{Templates/Film|title=SomeFilm|year=1999}} +<<Template page=Footer>> }}} -With a specific revision of the page: +Short syntax: {{{ -<<Template page=somepage rev=5>> -{{somepage?version=5}} +{{Footer}} }}} -If ENABLE_MARKUP_TEMPLATE is true, we support a Mediawiki-style syntax extension which maps +=== With parameters + +Plugin syntax: {{{ -{{TemplateFilm|title=Some Good Film|year=1999}} +<<Template page=Film vars="title=SomeFilm&year=1999">> }}} -to + +Short syntax: {{{ -<<Template page=TemplateFilm vars="title=Some Good Film&year=1999">> +{{Film|title=SomeFilm|year=1999}} }}} +=== With a specific revision of the page + +Plugin syntax: +{{{ +<<Template page=somepage rev=5>> +}}} + +Short syntax: +{{{ +{{somepage?version=5}} +}}} + == Arguments {| class="bordered" @@ -69,11 +84,13 @@ === Parameter expansion - vars="var1=value1&var2=value2" - We only support named parameters, not numbered ones as in Mediawiki, and the placeholder is %%var%% and not ~{~{~{var~}~}~} as in Mediawiki. +{{{ +vars="var1=value1&var2=value2" +}}} + The following predefined variables are automatically expanded if existing: {| class="bordered" |- @@ -116,22 +133,10 @@ == Inclusion -<noinclude> .. </noinclude> is stripped. +~<noinclude> .. ~</noinclude> is stripped. -<includeonly> .. </includeonly> is only expanded in pages using the template, not in the template itself. +~<includeonly> .. ~</includeonly> is only expanded in pages using the template, not in the template itself. -== Examples - -Standard syntax: -{{{ -<<Template page=TemplateExample vars="title=TestTitle">> -}}} - -Shorter syntax: -{{{ -{{TemplateExample|title=TestTitle}} -}}} - <noinclude> ---- [[PhpWikiDocumentation]] [[CategoryWikiPlugin]] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |