PmWiki /
Basic Variables← Notify | Variables | Page Variables → Where the variables are available as wiki markup they are shown as Variable value “{$VariableName}”.
$AsSpacedFunction = 'MyAsSpaced';
Variable value “ ”
$AuthorGroup = 'Users';
SessionAuth($pagename);
if( isset($AuthId) ) { // this person has been authenticated
SessionAuth($pagename);
if( isset($AuthPw) ) { // this person has entered a password
Variable value “PmWiki.BasicVariables”
# 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-/'] = '';
$CookiePrefix = 'pmwiki_'; # set cookie prefix to ‘pmwiki_’
$CookiePrefix = substr($tmp = md5(__FILE__), 0, 5).'_';
Variable value “Main”
Variable value “HomePage”
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.
Note: See comment below under $DefaultPage re the order how this must be defined within your (farm)config scripts - this must be set prior to any call of ResolvePageName().
Note: for $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 $PagePathFmt settings in different groups will cause cross-group linking anomalies.
$EnableLocalConfig = 0; # disable PmWiki's local/config
$EnablePGCust=0; # turn off per-page/group configs
$EnableWSPre = 1; # leading spaces are preformatted text
$EnableWSPre = 0; # leading spaces are normal lines of text
$EnableWSPre = 4; # 4+ spaces are preformatted text
# 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 = 1; # turn on WikiWord links
$LinkWikiWords = 0; # disable WikiWord links
Note, this setting requires WikiWords to be enabled, see $EnableWikiWords .
$LogoutRedirectFmt = 'Site.Logout'; # ?action=logout target
See + for more information, including when it’s possible to use this variable. Once you have $pagename , page variables become accessible:
$page = PageVar($pagename, '$FullName'); # =$pagename $group = PageVar($pagename, '$Group'); $name = PageVar($pagename, '$Name');
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 $PagePathFmt settings in different groups will cause cross-group linking anomalies.
Default Setting:
$PagePathFmt = array('{$Group}.$1','$1.$1','$1.{$DefaultName}');
Setting to use if you wish $DefaultName to actually be the name of your group home-pages:
$PagePathFmt = array('{$Group}.$1','$1.{$DefaultName}','$1.$1');
Do note that if the 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}');
Variable value “Site”
$SpaceWikiWords = 1; # turn on WikiWord spacing
$SpaceWikiWords = 0; # turn off WikiWord spacing
$TimeFmt = '%B %d, %Y'; # dates as "September 8, 2005"
$TimeFmt = '%Y-%m-%d'; # dates as "2005-09-08"
Variable value “pmwiki-2.2.96”
Variable value “2002096”
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.)
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 → This page may have a more recent version on pmwiki.org: PmWiki:BasicVariables, and a talk page: PmWiki:BasicVariables-Talk. |