[pmwiki-users] page text variables in config.php

Jon Haupt jhaupt at gmail.com
Thu Feb 15 22:34:06 CST 2007


I read in the documentation that I have to define $PageTextVarPatterns
in config.php if I want to refer to a page text variable in
config.php.  I'm trying to write something that will force PmWiki to
determine which skin to use based on a page text variable.  I don't
think I understand the correct syntax for PageTextVar().  Why doesn't
this work?

# special skin markup
SDVA($PageTextVarPatterns, array(
  'var:' => '/^:*(\\w[-\\w]*):[ \\t]?(.*)$/m',
  '(:var:...:)' => '/\\(:(\\w[-\\w]*):\\s?(.*?):\\)/s'));
$Blah = PageTextVar($pn,"Blah");
if ($Blah == "1") $Skin = 'pmwiki';
else $Skin = 'whatever';

Jon



More information about the pmwiki-users mailing list