< Notify | Variables | Page Variables >
Where the variables are available as wiki markup they are shown as Variable value "{$VariableName}".
$AsSpacedFunction
$AsSpacedFunction = 'MyAsSpaced';
$Author
is currently ""
$Author
$EnablePostAuthorRequired
.
$AuthorGroup
[[~AuthorName]]
$AuthorGroup = 'Users';
$AuthId
SessionAuth($pagename);
if( isset($AuthId) ) { // this person has been authenticated
$AuthPw
SessionAuth($pagename);
if( isset($AuthPw) ) { // this person has entered a password
$BaseName
is currently "PmWiki.BasicVariables"
$BaseName
$BaseNamePatterns
{$BaseName}
PageVariable. The key to the hash is the pattern to be replaced and the value is the replacement string.
# If {$FullName} is 'Group.Page-Draft' then {$BaseName} is 'Group.Page' $BaseNamePatterns['/-Draft$/'] = ''; # If {$FullName} is 'Comments-Group.Page' then {$BaseName} is 'Group.Page' $BaseNamePatterns['/^Comments-/'] = '';
$CategoryGroup
[[!CategoryName]]
$CookiePrefix
$CookiePrefix = 'pmwiki_';
# set cookie prefix to 'pmwiki_'
$CookiePrefix = substr($tmp = md5(__FILE__), 0, 5).'_';
$DefaultGroup
is currently "Main"
$DefaultGroup
$DefaultName
is currently "HomePage"
$DefaultName
$PagePathFmt
in addition to $DefaultName
if you really want it to take effect.
$DefaultPage
re the order how this must be defined within your (farm)config scripts - this must be set prior to any call of ResolvePageName().
$DefaultPage
$DefaultGroup
.$DefaultName
.
$DefaultGroup
, $DefaultName
and $DefaultPage
variables to work, they should be defined in the beginning of (farm)config.php, before any call to the function ResolvePageName(). This means, before any script from PmWiki and before any recipe that might be using this function. This also means it cannot be set in a per-page or per-group customization script - ResolvePageName() is called before these are loaded.
$DefaultName
, $DefaultPage
or $PagePathFmt
settings in different groups will cause cross-group linking anomalies.
$EnableLocalConfig
$EnableLocalConfig = 0; # disable PmWiki's local/config
$EnableStdConfig
$EnableStdConfig = 0; # disable many standard features
$EnablePGCust
$EnablePGCust=0; # turn off per-page/group configs
$EnableRedirect
$EnableRedirect
to zero causes PmWiki to pause and issue a "Redirect to link" message instead. This is sometimes useful when debugging recipes to be able to see the results of actions before page redirections occur. Not to be confused with $EnableRedirectQuiet
.
$EnableWikiWords
$EnableWSPre
$EnableWSPre = 1; # leading spaces are preformatted text
$EnableWSPre = 0; # leading spaces are normal lines of text
$EnableWSPre = 4; # 4+ spaces are preformatted text
$FTimeFmt
$FTimeFmt
is $TimeFmt
. (See Markup Expressions)
$GroupPattern
# limit groups to Site, SiteAdmin, PmWiki, and MyGroup
$GroupPattern = '(?:Site|SiteAdmin|PmWiki|MyGroup)';
#for case-sensitive group names, note the ?-i switch:
$GroupPattern = '(?-i:Site|SiteAdmin|PmWiki|MyGroup)';
$LinkWikiWords
(:linkwikiwords:)
and (:nolinkwikiwords:)
directives.
$LinkWikiWords = 1; # turn on WikiWord links
$LinkWikiWords = 0; # disable WikiWord links
$EnableWikiWords
.
$LogoutRedirectFmt
?action=logout
. Defaults to the current page.
$LogoutRedirectFmt = 'Site.Logout'; # ?action=logout target
$LogoutCookies
?action=logout
is invoked.
$NamePattern
$pagename
$pagename=$GLOBALS['MarkupToHTML']['pagename'];
global $pagename;
# if you use it inside a function
$pagename = ResolvePageName($pagename);
$pagename
, page variables become accessible:
$page = PageVar($pagename, '$FullName'); # =$pagename $group = PageVar($pagename, '$Group'); $name = PageVar($pagename, '$Name');
$PagePathFmt
$DefaultName
, $DefaultPage
or $PagePathFmt
settings in different groups will cause cross-group linking anomalies.
$PagePathFmt = array('{$Group}.$1','$1.$1','$1.{$DefaultName}');
$DefaultName
to actually be the name of your group home-pages:
$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}','$1.$1');
$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}');
$SiteGroup
is currently "Site"
$SiteGroup
$SiteAdminGroup
$Skin
$SpaceWikiWords
$AsSpacedFunction
. Note that this value can also be affected by the (:spacewikiwords:)
and (:nospacewikiwords:)
directives.
$SpaceWikiWords = 1; # turn on WikiWord spacing
$SpaceWikiWords = 0; # turn off WikiWord spacing
$TimeFmt
'%B %d, %Y at %I:%M %p'
, which gives dates of the form "September 8, 2005 at 10:57 PM".
$TimeFmt = '%B %d, %Y'; # dates as "September 8, 2005"
$TimeFmt = '%Y-%m-%d'; # dates as "2005-09-08"
$Version
is currently "pmwiki-2.2.145"
$Version
$VersionNum
is currently "2002145"
$VersionNum
$VersionNum
set to 2001040.
The first digit is a 2, the next three digits are the major
release number, and the last three digits are the minor release
number. Beta releases use 900-999 for the minor release number.
Thus:
2.1.0 2001000 2.1.1 2001001 ... 2.1.27 2001027 2.2.0-beta1 2001901 2.2.0-beta2 2001902 ... 2.2.0-beta18 2001918 ... 2.2.0 2002000
$WikiWordPattern
$EnableRelativePageVars
$EnableRelativePageVars
= 1; # PmWiki current default
{$Name}
displays the name of the physical page where it written. If {$Name}
is in an included page, it will display the name of the included page. (This is currently PmWiki's default.)
$EnableRelativePageVars
= 0; # revert to previous default
{$Name}
displays the name of the currently browsed page. Even if {$Name}
is in an included page, it will display the name of the browsed page. This was PmWiki's default in versions 2.2.8 and earlier, and changed in 2.2.9, but you can revert it back with this line in config.php.
{*$Name}
with an asterisk always displays the name of the currently browsed page, regardless of $EnableRelativePageVars
.
Categories: PmWiki Developer
< Notify | Variables | Page Variables >
This page may have a more recent version on pmwiki.org: PmWiki:BasicVariables, and a talk page: PmWiki:BasicVariables-Talk.