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. |
From: <var...@us...> - 2009-02-24 16:34:55
|
Revision: 6553 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6553&view=rev Author: vargenau Date: 2009-02-24 16:34:42 +0000 (Tue, 24 Feb 2009) Log Message: ----------- Table header Modified Paths: -------------- trunk/pgsrc/Help%2FTemplatePlugin Modified: trunk/pgsrc/Help%FTemplatePlugin =================================================================== --- trunk/pgsrc/Help%2FTemplatePlugin 2009-02-24 16:32:08 UTC (rev 6552) +++ trunk/pgsrc/Help%2FTemplatePlugin 2009-02-24 16:34:42 UTC (rev 6553) @@ -77,8 +77,8 @@ The following predefined variables are automatically expanded if existing: {| class="bordered" |- -| Variable -| Description +! Variable +! Description |- | pagename | This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
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. |
From: <var...@us...> - 2022-02-15 14:32:41
|
Revision: 10993 http://sourceforge.net/p/phpwiki/code/10993 Author: vargenau Date: 2022-02-15 14:32:37 +0000 (Tue, 15 Feb 2022) Log Message: ----------- pgsrc/Help%2FTemplatePlugin: sectionhead is a boolean Modified Paths: -------------- trunk/pgsrc/Help%2FTemplatePlugin Modified: trunk/pgsrc/Help%2FTemplatePlugin =================================================================== --- trunk/pgsrc/Help%2FTemplatePlugin 2022-02-14 17:54:35 UTC (rev 10992) +++ trunk/pgsrc/Help%2FTemplatePlugin 2022-02-15 14:32:37 UTC (rev 10993) @@ -1,4 +1,4 @@ -Date: Thu, 9 Dec 2021 18:48:34 +0000 +Date: Tue, 15 Feb 2022 15:30:00 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.6.1) Content-Type: application/x-phpwiki; pagename=Help%2FTemplatePlugin; @@ -60,24 +60,24 @@ ! Default value |- | **page** -| pagename to be included as template +| The page to include as template. | //none// (required argument) |- | **vars** -| optional parameters to be expanded inside the template +| Optional parameters to be expanded inside the template. | //empty// |- | **rev** -| page revision +| Page revision. | most recent revision |- | **section** -| just include a named section +| Just include a named section. | //empty// |- | **sectionhead** -| when including a named section show the heading -| //empty// +| Boolean. If true, when including a named section show the heading. +| false |} === Page to include === This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <var...@us...> - 2009-04-18 16:18:46
|
Revision: 6782 http://phpwiki.svn.sourceforge.net/phpwiki/?rev=6782&view=rev Author: vargenau Date: 2009-04-18 16:18:45 +0000 (Sat, 18 Apr 2009) Log Message: ----------- Allow "Template:" and "Template/" prefix (Mediawiki compatibility) Modified Paths: -------------- trunk/pgsrc/Help%2FTemplatePlugin Modified: trunk/pgsrc/Help%FTemplatePlugin =================================================================== --- trunk/pgsrc/Help%2FTemplatePlugin 2009-04-18 16:12:07 UTC (rev 6781) +++ trunk/pgsrc/Help%2FTemplatePlugin 2009-04-18 16:18:45 UTC (rev 6782) @@ -1,4 +1,4 @@ -Date: Thu, 26 Mar 2009 11:34:32 +0000 +Date: Sat, 18 Apr 2009 18:17:26 +0000 Mime-Version: 1.0 (Produced by PhpWiki 1.3.14-20080124) X-Rcs-Id: $Id$ Content-Type: application/x-phpwiki; @@ -82,6 +82,16 @@ | (empty) |} +=== Page to include + +If "Template:$page" exists, it is used. + +Else, if "Template/$page" exists, it is used. + +Else "$page" is used. + +This allows compatibility with Mediawiki that puts templates in the "Template:" namespace. + === Parameter expansion We only support named parameters, not numbered ones as in Mediawiki, and This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |