< Notify | Variables | Page Variables >
Where the variables are available as wiki markup they are shown as Variable value "{$VariableName}
".
$AsSpacedFunction
AsSpaced
'.
: :$AsSpacedFunction = 'MyAsSpaced';
$Author
is currently ""
:$Author : Set to the current reader, who is potentially an author ([[PmWiki:AuthoringPhilosophy|see discussion]]). See also $EnablePostAuthorRequired.
$AuthorGroup
Profiles
'. This variable is implicit in the markup [[~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
Category
'. (See Categories). This variable is implicit in the markup [[!CategoryName]]
$CookiePrefix
: :$CookiePrefix = 'pmwiki_'; # set cookie prefix to 'pmwiki_'
: :$CookiePrefix = substr($tmp = md5(__FILE__), 0, 5).'_';
$DefaultGroup
is currently "Main"
$DefaultGroup
$DefaultName
is currently "Description"
$DefaultName
: :Note that the behavior will differ based on whether the page exists or not. Probably you want to alter $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.php
scripts - this must be set prior to any call of ResolvePageName()
.
:$DefaultPage:Startup page when PmWiki is called without a specified page, normally ''@@$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.
: : Please note that this variable is intended to be set in (farm)config.php
, not in individual groups. Trying to use different $DefaultName@@, @@$DefaultPage
or
settings in different groups will cause cross-group linking anomalies.
$PagePathFmt
$EnableLocalConfig
local/config.php
customizations (usually for a farm's wikis). Can be set to zero in local/farmconfig.php
to prevent the farm's wikis' local/config.php
from being loaded.
: :$EnableLocalConfig = 0; # disable PmWiki's local/config
$EnableStdConfig
scripts/stdconfig.php
and a large part of the core functionalities provided by the scripts in the pmwiki/scripts
directory and outlined in the core documentation, unless included by your own local configuration (notably core markup rules, page history, skins, uploads). Allows you to completely reshape the way PmWiki behaves, if you need to.
: :$EnableStdConfig = 0; # disable many standard features
$EnablePGCust
: :$EnablePGCust = 0; # turn off per-page/group configs
:$EnableBaseNameConfig:When enabled, and if the page has a different base page (per $BaseNamePatterns), will include the local configuration for the base page. For example, if the page is "Group.Page-Draft", this would try to include the file local/Group.Page.php
in addition to local/Group.Page-Draft.php
.
: :$EnableBaseNameConfig = 1; # include basename configuration
:$EnableRedirect:When enabled (default), causes page redirects to automatically be performed by the browser. Setting $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:Can be used to override the default date format used by the "@@ftime@@" function. The default $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
: :Note, this setting requires WikiWords to be enabled, see $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
: : Please note that this variable is intended to be set in (farm)config.php
, not in individual groups. Trying to use different $DefaultName@@, @@$DefaultPage
or
settings in different groups will cause cross-group linking anomalies.
$PagePathFmt
$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');
Groupname.Groupname
page does exist but Groupname.Defaultname
does not exist, then Groupname.Groupname
will still take precedence. You may remove the '$1.$1
' entirely to require Groupname.Defaultname
to be the group homepage - that would look like this:
$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}');
$SiteGroup
is currently "Site"
$SiteGroup
$SiteAdminGroup
SiteAdmin
'.
$Skin
:$SpaceWikiWords:If set, then WikiWords in pages are automatically spaced according to $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: The format to use for dates and times, in [[https://www.php.net/manual/en/function.strftime.php | %hlt php%@@strftime()@@]] format. The default value is '%B %d, %Y at %I:%M %p'
, which gives dates of the form "September 8, 2005 at 10:57 PM". Formats $CurrentTime variable.
: :$TimeFmt = '%B %d, %Y'; # dates as "September 8, 2005"
: :$TimeFmt = '%Y-%m-%d'; # dates as "2005-09-08"
$EnableFTimeNew
{(ftime)}
markup expression. See explanation at Functions#PSFT. (For PHP 8.1, strftime() is deprecated, and the new functions are enabled by default.)
$Version
is currently "pmwiki-2.3.35"
$Version
$VersionNum
is currently "2003035"
$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
In this case {$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
In this case {$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 >