[pmwiki-users] Markup to change page variable

Anke Wehner anke.wehner at gmail.com
Sun Jan 27 06:58:57 CST 2008

Hi again...

I've run into another little snag with what I'd like to do.
I have a page variable $CommentPage, which usually is Comments-{$FullName}
What I'd like to be able to do is putting a markup tag on specific
pages to change $CommentPage - to have two or more wiki pages share
one comment page.

Trying to follow an example on the Custom Markup page, I arrived at
the following:

SDV($CommentPage, $pagename);

if ( substr_count($pagename, 'Comments') == 0) {
  global $CommentPage;
  $CommentPage = 'Comments-'.$CommentPage ;

Markup('CommentPage', '<{$var}', '/\\(:commentpage\\s(.*?):\\)/e',
function setCommentPage($val) {
  global $CommentPage;
  $CommentPage = '$val';

$FmtPV['$CommentPage'] = '$GLOBALS["CommentPage"]';

That causes a page with the (:commentpage ...:) markup to render not at all.
Does anyone spot an obvious mistake, or has any other advice?


More information about the pmwiki-users mailing list