[pmwiki-users] Fwd: Custom markup accessing page variables in an included page

DaveG pmwiki at solidgone.com
Fri Oct 23 16:39:05 CDT 2009



Maxim wrote:
> I have some custom markup. It is an evaluated function; in its markup,
> it wants to access the value of $Name for the page it is on. It does
> this like so:
> 
> global pagename;
> $filename = PageVar($pagename, '$Name') . $desc . '.png';
> 
> This works fine but as soon as this custom markup is transcluded in
> another page, the value of $Name reflects that page, not the original.
> I don't really want to have {$Name} specified in the markup (which I
> think would allow (:include basepage= :) to work). Within the context
> of the markup function, is it possible for it to know the original (base)
> page name?
Normally, I'd pass the pagename to the markup-function as a parameter in 
the markup. That way, I can specify the appropriate pagename reference 
in the parameter, so either  {$FullName}, {*$FullName}, or {=$FullName} 
(ref PmWiki/PageVariables).


  ~ ~ David




More information about the pmwiki-users mailing list