[Pmwiki-users-de] Markup-Function

Hans design at flutesong.fsnet.co.uk
Mon Jul 4 07:23:49 CDT 2005


Thursday, June 30, 2005, 10:38:57 AM, dbheide wrote:
> Mein Problem:
> Eine Adressdatei soll sortiert werden und dann angezeigt werden.
> In der Template-Datei kann ich diese Funktion nicht einbinden, sondern
> nur auf einer bestimmten Seite soll das ja geschehen. Also benötige ich
> die (:markup:)-Funbktion.

> Ich kann aber nicht erkennen, wie sich diese zusammensetzt und
> funktioniert.
> Danke für alle Hilfe!

http://www.pmwiki.org/wiki/PmWiki/CustomMarkup erklärt in Englisch wie
markup gebaut ist.

davon:

Call a user function which returns some content

An 'e' option on the $pattern parameter will make PmWiki interpret the
$replace parameter not as a replacement text, but as a PHP expression
that returns the replacement text.

The markup (:meeting:) uses this by calling a hypothetical global
function meeting() (say, defined in config.php), which is supposed to
return the date of the next BLUG Meeting as a string:

Markup('meeting', 'directives', '/\\(:meeting:\\)/e', 'meeting()');

Also wenn Du eine Funktion adressliste() schreibst  z.B. in
config.php, dann kannst Du sie durch markup (:Adressen:) anzeigen,
wenn Du in config.php dieses Markup definierst, wie:

Markup('Adressliste', 'directives', '/\\(:Adressen:\\)/e', 'adressliste()');

Die Funktion adressliste() kann global in config.php definiert werden,
oder in einer Script (zB address.php im cookbook/ Verzeichnis) ,
die dann in config.php gerufen wird, z.B

include_once('cookbook/address.php');


Alles Gute,
~Hans                           




More information about the pmwiki-users-de mailing list