|
Cookbook /
VariablesSummary: Allows to set variables in Wiki text to be used in the text and/or if markups
Version: 1.0
Prerequisites: PmWiki 2.1.5
Status: Stable
Maintainer: Americo Albuquerque
Categories: Obsolete
Questions answered by this recipeIs there a markup to define a variable in a page, that can be used lateron?
DescriptionThis recipe allows you to set variables that can be used later. Those variables are used using the NotesThere are some problems inherent to the way PmWiki works that you have to take in consideration when using variables. The variable value used in Release NotesThere are some changes that need to be done to the main PmWiki php file for this recipe to work. Currentely, PmWiki doesn't allow to run 2 markups using the same regexp. This recipe needs that funtionality, so, for it to work you have to make this changes in pmwiki.php (on your main pmwiki install dir) In BuildMarkupRules change
$MarkupRules[str_replace('\\L',$LinkPattern,$m['pat']] = $m['rep'];
to
$MarkupRules[] = array('pat'=>str_replace('\\L',$LinkPattern,$m['pat']), 'rep'=>$m['rep']);
and in MarkupToHTML change
foreach($markrules as $p=>$r) {
to
foreach($markrules as $preg) {
$p = $preg['pat'];
$r = $preg['rep'];
Comments
See Also
Contributors |