admins (advanced)

%apply=item id=Enable Link Page Relative?%$EnableLinkPageRelative
When enabled, causes Pm Wiki to use relative UR Ls? for page links (without the https://domain.tld part) instead of absolute UR Ls?.
%apply=item id=Enable Relative Page Links?%$EnableRelativePageLinks
Controls how page links without a "Group" name behave in included pages (such as a sidebar). When off (0), links in included pages behave as if they were written in the page you're viewing; when on (1, default), they behave as if they were written in the included page's own group.
For example, if Site.Side Bar has a link [[Page]], and you're in the Main group, the link will point to Site.Page. Setting $EnableRelativePageLinks = 0; will make the link point to Main.Page when viewed from the Main group, and to Pm Wiki.Page when viewed from the Pm Wiki group.
%apply=item id=Enable Link Plus Titlespaced?%$EnableLinkPlusTitlespaced
When enabled, a link written like [[Name|+]] will display the "Spaced Title". Default is to display the "Title" of the page. See the page PageVariables for {$Title} and {$Titlespaced}.
%apply=item id=Enable Obfuscate Emails?%$EnableObfuscateEmails
If set to 1, will enable email obfuscation that makes it less likely for spambots to collect addresses from the wiki. It is equivalent to setting:
$LinkFunctions['mailto:'] = 'ObfuscateLinkIMap';
%apply=item id=Page Path Fmt?%$PagePathFmt
This array lists the order in which Pm Wiki looks for the page that you most likely are attempting to link to. The default is listed below. Look at Cookbook:PagePaths for some ideas.
array('{$Group}.$1', '$1.$1', '$1.{$DefaultName}')
%apply=item id=Link Page Exists Fmt?%$LinkPageExistsFmt
The (HTML) string to output for links to already existing wiki pages. Defaults to
<a class='wikilink' href='\$LinkUrl'>\$LinkText</a>
%apply=item id=Link Page Create Fmt?%$LinkPageCreateFmt
The (HTML) string to output for links to non-existent wiki pages. The default is to add a '?' after the link text with a link to the page edit/create form. Defaults to
<a class='createlinktext' href='\$PageUrl?action=edit'>\$LinkText</a>
<a class='createlink' href='\$PageUrl?action=edit'>?</a>
%apply=item id=Link Page Create Space Fmt?%$LinkPageCreateSpaceFmt
Same as $LinkPageCreateFmt, but used when the link text has a space in it.
%apply=item id=Link Page Self Fmt?%$LinkPageSelfFmt
The (HTML) string to output for self-referencing links (i.e. links to the page itself). Defaults to
<a class='selflink' href='\$LinkUrl'>\$LinkText</a>
%apply=item id=Link Page Short Fmt?%$LinkPageShortFmt
An array with shortcuts to page properties shown as link texts or tooltip titles. For example:
$LinkPageShortFmt['+'] = '{$Title}'; # this is the default, can now be changed
$LinkPageShortFmt['++'] = '{$Groupspaced} / {$Titlespaced}';
$LinkPageShortFmt['?'] = '{$Description}';

These can be used like [[Page1|+]] to set link text to the page title, or [[Page1"+"|click here]] to set the tooltip title.

%apply=item id=Link Page Tooltip?%$LinkPageTooltip
The default tooltip title for page links, if not defined in the wiki markup. Can include page variables or short codes defined in $LinkPageShortFmt.
%apply=item id=Link Category Fmt?%$LinkCategoryFmt
The (HTML) string to output for links to wiki category pages. Defaults to
<a class='categorylink' href='\$LinkUrl'>\$LinkText</a>
%apply=item id=Url Link Fmt?%$UrlLinkFmt
The (HTML) string to output for URL-links that begin with 'http:', 'ftp:', etc. Defaults to
<a class='urllink' href='\$LinkUrl' title='\$LinkAlt' rel='nofollow'>\$LinkText</a>
All Inter Map links default to $UrlLinkFmt, unless there is a specific $IMapLinkFmt entry.
To configure external links so that the browser omits the Referer header or otherwise leak no referrer information, you may want to set this to:
$UrlLinkFmt = "<a class='urllink' href='\$LinkUrl'
title='\$LinkAlt' rel='noreferrer nofollow'>\$LinkText</a>";
%apply=item id=I Map Link Fmt?%$IMapLinkFmt
an array of link formats for various link "schemes". Not set as default.
Examples of custom formats to allow different styling via classes:
Links to http: insecure url links:
$IMapLinkFmt['http:'] = "<a class='httplink urllink' href='\$LinkUrl'>\$LinkText</a>";
Links to https: secure pages:
$IMapLinkFmt['https:'] = "<a class='httpslink urllink' href='\$LinkUrl'>\$LinkText</a>";
Links to Pm Wiki: Inter Map shortcut:
$IMapLinkFmt['PmWiki:'] = "<a class='pmwikilink urllink' href='\$LinkUrl'>\$LinkText</a>";
Note that if you have enabled Obfuscate Link I Map? (core function based on De Ob Mail?), the snippet can be customized in:
$IMapLinkFmt['obfuscate-mailto:']
The default (for Obfuscate Link I Map?) is:
$IMapLinkFmt['obfuscate-mailto:'] = "<span class='_pmXmail' title=\"\$LinkAlt\"><span class='_t'>\$LinkText</span><span class='_m'>\$LinkUrl</span></span>";
The Obfuscate Link I Map? logic expects the snippet to have some recognisable properties -- classes, elements, otherwise it may not work. Start with the default snippet, make small modifications, and test if it works.
%apply=item id=Add Link CSS?%$AddLinkCSS
An array of additional custom link CSS classes, that are added to the link format $UrlLinkFmt, $IMapLinkFmt or $LinkPageExistsFmt. Currently can have 2 elements:
$AddLinkCSS['othergroup'] = "crossgroup"; # add "crossgroup" class to wikilinks to other wikigroups
$AddLinkCSS['samedomain'] = "currentsite"; # add "currentsite" class to URL or Path links to resources on the same domain.
%apply=item id=Inter Map Files?%$InterMapFiles
An array consisting a list of files and pages containing InterMap entries to be loaded.
%apply=item id=Make Page Name Function?%$MakePageNameFunction
Name of a custom function to replace MakePageName(), which converts strings into valid page names.
%apply=item id=Make Page Name Patterns?%$MakePageNamePatterns
$MakePageNamePatterns is an array of regular expression replacements that is used to map the page link in a free link such as [[free link]] into a page name. Currently the default sequence is:
    "/'/" => '',                    # strip single-quotes
    "/[^$PageNameChars]+/" => ' ',  # convert to spaces characters not allowed in pagenames
    '/((^|[^-\\w])\\w)/' => 'cb_toupper',  # capitalize 1st letter of words
    '/ /' => ''                     # remove spaces
Note that if you change $MakePageNamePatterns, the documentation links may break. This can be fixed by re-setting $MakePageNamePatterns to the default in Pm Wiki?.php.
%apply=item id=Make Page Name Split Pattern?%$MakePageNameSplitPattern
See Cookbook:DotsInLinks.
%apply=item id=Wiki Word Count Max?%$WikiWordCountMax
The maximum number of times to convert each Wiki Word encountered on a page. Defaults to 1,000,000. Common settings for this variable are zero (disable Wiki Word links) and one (convert only the first occurrence of each Wiki Word).
$WikiWordCountMax = 0; # disable Wiki Word links
$WikiWordCountMax = 1; # convert only first Wiki Word
%apply=item id=Wiki Word Count?%$WikiWordCount
An array that allows the number of Wiki Word conversions to be set on a per-Wiki Word basis. The default is to use $WikiWordCountMax unless a value is set in this array. By default Pm Wiki sets $WikiWordCount['Pm Wiki']=1 to limit the number of conversions of "Pm Wiki".
$WikiWordCount[=['PhD']=0;     # Don't convert "PhD"=]
$WikiWordCount['WikiWord']=5;  # Convert WikiWord 5 times
# the following lines keep a page from linking to itself
$title = [=FmtPageName=]('$Title_',$pagename);
$WikiWordCount[$title]=0;    
%apply=item id=Enable Redirect Quiet?%$EnableRedirectQuiet
Enable the quiet=1 parameter for the redirect directive. On publicly edited wikis it is advisable not to enable quiet redirects.
$EnableRedirectQuiet = 0; # disable quiet redirects (default)
$EnableRedirectQuiet = 1; # enable quiet redirects with quiet=1
$EnableRedirectQuiet = 2; # enable quiet redirects unless quiet=0
%apply=item id=Qualify Patterns?%$QualifyPatterns
An array of regular expression replacements applied when text from one page is included in another, used by the function Qualify(). The two default patterns rewrite links like [[Page]] into [[Group/Page]], and page (text) variables like {$Title} into {Group.Page$Title} so that they work the same way in the source page and in the including page.

Categories: PmWiki Developer


This page may have a more recent version on pmwiki.org: PmWiki:LinkVariables, and a talk page: PmWiki:LinkVariables-Talk.


Page last modified on August 11, 2025, at 05:12 am