authors (intermediate)
This page describes the “variables” that are associated with pages. Page variables have the form @$\'\'variable\'\'@, and can be used in page markup or in certain formatting strings in PmWiki. For example, the markup “[]” renders in this page as “PmWiki”.
Note that these variables do not necessarily exist in the PHP code, because they have to be determined for a specific page. (However, they are usable in FmtPageName strings.)
There is also the form @\'\'pagename\'\'$\'\'variable\'\'@, which returns the value of the variable for another page. For example, “[MarkupMasterIndex]” displays as “Markup Master Index”.
Default page variables
The page variables defined for PmWiki are:
(:description:) markup, as in “Documentation for “variables” that are associated with pages.”
[= and =] to avoid having PmWiki process any markup that may be contained in the summary.
In addition to the above, there are some page-invariant variables available through this markup:
Custom page variables
You may add custom page variables as a local customization. In a local configuration file or a recipe script, use the variable $FmtPV:
$FmtPV['$VarName'] = "'variable definition'"; $FmtPV['$CurrentSkin'] = '$GLOBALS["Skin"]';
Defines new Page Variable of name $CurrentSkin, which can be used in the page with [] (also for Conditional markup). It’s necessary to use the single quotes nested inside double-quotes as shown above (preferred) or a double-quoted string nested inside single-quotes like '"this"'.
Making a [] markup doesn’t quite follow the formula above. Instead you need to use
$FmtPV['$WikiTitle'] = '$GLOBALS["WikiTitle"]';
See also
- Cookbook:More custom page variables
- PmWiki.Variables — about variables internal to PmWiki.
- PmWiki.MarkupMasterIndex — complete list of PmWiki markups.
« Conditional markup | Documentation Index | Markup master index »

