[pmwiki-users] Using variable in skin template
design5 at softflow.co.uk
Sat Oct 24 10:57:53 CDT 2009
Saturday, October 24, 2009, 4:04:34 PM, DaveG wrote:
>> 3. use of $pagename: use $pn rather than $pagename as $ pagename may
>> have a different value.
> Not sure about this. Is $pn globally available? Not sure, but it doesn't
> look like it. I'd always thought $pagename referred to the current page
> from within skin/config files.
If you use $pagename in a $FmtPV[...] setting,
it will use whatever the value of $pagename is at that point
in config.php. This may be what you need, but it may also be
different, depending on what page the page variable markup
is encountered, and how $EnableRelativePageVars is set.
If you use $pn, then it will only be filled when the $FmtPV item is
evaluated, and will be correct as for that circumstance.
You can see in pmwiki.php that the $FmtPV items use $pn throughout.
More information about the pmwiki-users