VorlagePlugin
Synopsis
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.
Usage
<?plugin Template page=Vorlage/Footer?> <?plugin Template page=Vorlage/Film vars="title=SomeFilm&year=1999" ?> {{Vorlage/Film|title=SomeFilm|year=1999}}
Plugin Argumente
Argument | Vorgabewert | Beschreibung |
---|---|---|
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 the placeholder is %%var%% and not Plugin Template failed. Page “~{var~” does not exist.} as in mediawiki.
The following predefined variables are automatically expanded if existing:
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 and BASE_URL
<noinclude> .. </noinclude> is stripped
In work:
- ENABLE_MARKUP_TEMPLATE = true: (lib/InlineParser.php) Support a mediawiki-style syntax extension which maps
{{TemplateFilm|title=Some Good Film|year=1999}}
to
<?plugin Template page=TemplateFilm vars="title=Some Good Film&year=1999" ?>
Examples
<?plugin Template page=VorlageBeispiel vars="title=TestTitle" ?>
- Standard syntax
Titel: TestTitle Jahr: %%year%% ---
- Seitenname: %%pagename%%
- Autor: %%author%%
- Datum der Erzeugung: %%ctime%%
- Erzeuger: %%creator%%
- SERVER_URL: https://bh.hallikainen.org
- DATA_PATH:
- SCRIPT_NAME: /index.php
- PHPWIKI_BASE_URL: https://bh.hallikainen.org/index.php/
- BASE_URL: https://bh.hallikainen.org/index.php/
- Shorter syntax
Titel: TestTitel Jahr: %%year%% ---
- Seitenname: %%pagename%%
- Autor: %%author%%
- Datum der Erzeugung: %%ctime%%
- Erzeuger: %%creator%%
- SERVER_URL: https://bh.hallikainen.org
- DATA_PATH:
- SCRIPT_NAME: /index.php
- PHPWIKI_BASE_URL: https://bh.hallikainen.org/index.php/
- BASE_URL: https://bh.hallikainen.org/index.php/
PhpWikiDokumentation WikiPlugin