Variable substitutions in the skin template are all managed by the FmtPageName() function from pmwiki.php. Pmwiki variable substitutions available on pages are managed by the substitutions from stdmarkup.php or superseded in local/config files.
:ActionSkin['print']='foo' to use the 'foo' skin when printing, regardless of what the
- A variable which contains the Wiki title as displayed by the browser
- An array of CSS statements to be included in the page's output along with other HTML headers. This array provides an easy place for scripts to add custom CSS statements.
- An array of HTML text to be included in the page's <head> section, at the point where the skin template specifies a
<!--HTMLHeader-->
directive. This array provides an easy place for scripts to add custom HTML headers.
For example, if you want to specify a logo for all the pages of your wiki (a png image for Firefox (and others...), an ico for Internet Explorer):
$HTMLHeaderFmt['logo'] =
'<link href="http://path/to/logo.png" type="image/png" rel="icon" />
<link href="http://path/to/logo.ico" type="image/x-icon" rel="shortcut icon" />';
Another example, if you want to get the rss notification on some browsers (the rss icon in firefox for instance):
$HTMLHeaderFmt['rss'] =
'<link rel="alternate" type="application/rss+xml" title="Rss All recent Changes"
href="$ScriptUrl/Site/AllRecentChanges?action=rss" />';
:HTMLHeaderFmt above, this contains an array of HTML text to be included near the end of an HTML document, at the point where the skin template specifies a <!--HTMLFooter-->
directive (usually just before a closing </body> tag). Primarily used by scripts to add custom HTML output after the body of the page output.
:<meta name='robots' ... />
tag generated by PmWiki to control search engine robots accessing the site. PmWiki's default setting tells robots to not index anything but the normal page view, and to not index pages in the PmWiki [[wiki group]]. Explicitly setting MetaRobots overrides this default.
# never index this site
= 'noindex,nofollow';
# disable the robots tag entirely
= '';
- An array of HTML text to be displayed at the point of any
(:messages:)
markup. Commonly used for displaying messages with respect to editing pages.
- An array specifying the format of the RecentChanges listing.
The format can be specified in your config.php using the following:
$RecentChangesFmt['$SiteGroup.AllRecentChanges'] =
'* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';
$RecentChangesFmt['$Group.RecentChanges'] =
'* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';
Note that changes made to the format will only affect new edits. In other words, you will need to edit a page for your new format to be visible. Note also that you need to have two spaces between the page name and the other information about the edit.
Also note that this variable has other uses, such as not reporting at all to RecentChanges and AllRecentChanges as found here
PmWiki Questions.
:RecentChangesFmt. If enabled, newly uploaded files will be logged to the RecentChanges pages. Default is disabled. See Cookbook:RecentUploadsLog for more information.
- An array specifying the format of the RecentChanges listing when saving Draft pages.
DraftRecentChangesFmt when a Draft page is saved. For example, you could save drafts in a separate Recent Draft Changes page and not list in the normal group's Recent Changes page:
$DraftRecentChangesFmt['$Group.RecentDraftChanges'] =
'* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';
$DraftRecentChangesFmt['$Group.RecentChanges'] = '';
- The maximum number of lines to be stored in RecentChanges pages. The default is zero, meaning "no limit".
= 1000; # maintain at most 1000 recent changes
- The text to be used when a page is redirected via the
(:redirect:)
markup.
$PageRedirectFmt = '<p><i>redirected from $FullName</p>';
$PageRedirectFmt = '';
- An array which contains the predefined WikiStyles which can be used on a textpage.
See: PmWiki.CustomWikiStyles
:(:include:)
and other directives, used to control recursion and otherwise pose a sanity check on page contents. MaxIncludes defaults to 50, but can be set to any value by the wiki administrator.
= 50; # default
= 1000; # allow lots of includes
= 0; # turn off includes
:ActionSkin. Normally
- Set by scripts/skins.php to be the base url of the current skin's directory (i.e., within a 'pub/skins/' directory). This variable is typically used inside of a skin .tmpl file to provide access to .css files and graphic images associated with the skin.
- An array which, given the filesystem path (array key) to a skin (or a directory containing several skins), provides the corresponding URL (array value).
The array key is the directory containing the skin.tmpl and skin.php files, as seen by the PmWiki program. It does not have to be publicly accessible.
The value is the URL (web address) of the directory containing the .css, .gif, and other files which appear in the HTML code sent by PMWiki to the browser. This directory must be publicly accessible.
By default
is set to:
$SkinLibDirs = array(
"./pub/skins/\$Skin" => "$PubDirUrl/skins/\$Skin",
"$FarmD/pub/skins/\$Skin" => "$FarmPubDirUrl/skins/\$Skin");
Extra details: When PMWiki is searching for a skin it looks for a directory named for the skin in the array index/keys, and if it finds it then it will use the files in that directory and also the files in the matching array value url. The two sides normally point to the same publicly accessible directory, but they do not have to.
- is the url that refers to a logo image which most skins display somewhere in the page's header (top left usually).
- Changes the handling of the page URL. When set to
1
page URL will be ...wiki.php/Main/Main
, when set to 0
(default) it will be ...wiki.php?n=Main.Main
.
:PagePathFmt in order to make a complete page name from the partial one, then issues a "redirect" to the browser to tell it to reload the page with the correct full page name. Setting
=0; blocks the redirect, so that PmWiki continues processing with the adjusted page name rather than issuing the redirect.
- Defines the markup placed at the top of every page. Default value is:
Group.GroupHeader:)(:nl:)';
- Defines the markup placed at the top of every page when
action=print
. Default value is:
SDV(Group.GroupPrintHeader:)(:nl:)');
- Defines the markup placed at the bottom of every page. Default value is:
Group.GroupFooter:)(:nl:)';
- Defines the markup placed at the bottom of every page when
action=print
. Default value is:
SDV(Group.GroupPrintFooter:)');
- Specifies the HTTP header to send when attempting to browse a page that doesn't exist. Some webserver packages (notably Microsoft's "Personal Web Server") require that this variable be changed in order to work.
# default
$PageNotFoundHeaderFmt = 'HTTP/1.1 404 Not Found';
# return all pages as found
$PageNotFoundHeaderFmt = 'HTTP/1.1 200 Ok';
Beware when expecting to return the content of a Group(header|footer) for an non existent page! By default PmWiki returns 404 (because the page does not exist), despite there is some content to show. Firefox shows the content, while Internet Explorer displays its default 404 page.
MUST be set to return 200 as described above in order to get the expected behaviour with all browsers.
- Setting
in a local customizationfile (e.g., local/config.php
) prevents insertion of spacer paragraphs (<p class='vspace'></p>
) in generated HTML code. To limit this change to a single skin, place the
statement in a skin.php file, preceded by the statement global
.
:TableCellCount which holds the horizontal column number of the current cell.
:TableRowCount to give the absolute row number within the table, or TableRowIndexMax.
# Give each row a unique CSS class based on row number (tr1, tr2, tr3, ... )
TableRowCount'";
# Give each row alternating CSS classes (ti1, ti2, ti1, ti2, ti1, ... )
= 2;
TableRowIndex'";
:TableRowIndex in Tables.
# Set rows indexes as 1, 2, 3, 1, 2, 3, 1, 2, ...
= 3;
- TableCellCount']
- PMWiki internal variable - Horizontal column number of the current cell. For use in TableRowAttrFmt. Administrators can use in TableRowAttrFmt.
Example:
- TableRowCount']
- PMWiki internal variable - Current row number. Administrators can use in TableRowAttrFmt.
Example: TableRowAttrFmt = "class='row$TableRowCount'";
- TableRowIndex']
- PMWiki internal variable - Row index number derived from TableCellAttrFmt and/or
.
Example:
See also: Edit Variables