< I18n Variables | Variables | Link Variables >
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 $Skin
variable is set to.
(:title ...:)
page directives (added in PmWiki 2.2.9).
$EnablePageTitlePriority = 0;
# PmWiki default, last encountered title wins (the title may be changed from included pages or GroupFooter).
$EnablePageTitlePriority = 1;
# First title wins; if a title is defined in the page, directives from included pages cannot change it.
$EnableDiffInline = 0;
# Disable colors, show plain text differences
(All)RecentChanges
pages will display the difference in bytes of the page content from the previous version like (+123) or $EnableRCDiffBytes = 1;
# Show bytes difference from previous version
pub/css/local.css
something like: .diffmarkup { font-family: monospace; font-size: 0.9em; } .diffmarkup del { background: #ff9; text-decoration: none; } .diffmarkup ins { background: #9f9; text-decoration: none; }
RecentChanges
(before 2.3.0), and in user signatures.
RecentChanges
(since 2.3.0). This time stamp will be saved in the wiki source text in Greenwich Mean Time (UTC/GMT), but will be shown according to $TimeFmt in the timezone of the wiki. When $EnableLocalTimes is enabled, then it will be shown in the visitor's time zone. The same format is also saved in user signatures if $EnableLocalTimes is enabled.
pub/pmwiki-utils.js
should be loaded or not. The script contains JavaScript utility functions for the table of contents, the syntax highlighting, the recent changes, and the email obfuscation. By default $EnablePmUtils is 1 (enabled), but its functions should be enabled individually ($EnableLocalTimes, $EnableHighlight, $PmTOC, $LinkFunctions['mailto:']). Set this variable to 0 to disable all these functions.
$EnableLocalTimes = 2;
Enables long local times, as in MM/DD/YYYY HH:MM:SS.
$EnableLocalTimes = 1;
Enables compact local times, either HH:MM (within 24 hours), MM/DD or DD/MM (within 11 months), and MM/DD/YYYY or DD/MM/YYYY if earlier than 11 months. The long format appears in a tooltip title when the mouse is over the short format.
$EnablePmSyntax = 1; # highlight documentation blocks $EnablePmSyntax = 2; # both documentation and edit form if ($action=='edit') $EnablePmSyntax = 2; # only edit form
%highlight%
, see WikiStyles#highlight.
[+]
button near the top right of preformatted blocks. A user clicking on the button will have the text of the preformatted block copied to their system clipboard: $EnableCopyCode = 1; # add a [+] copy code button to pre blocks
<html...>
tag in the skin template, default empty. For example, to add a "lang" attribute, set in config.php
: $HTMLTagAttr = 'lang="en" xml:lang="en"';
<html xmlns="http://www.w3.org/1999/xhtml" $HTMLTagAttr>
<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.
$HTMLHeaderFmt['favicon'] = '<link href="http://path/to/icon.png" type="image/png" rel="icon" /> <link href="http://path/to/icon.ico" type="image/x-icon" rel="shortcut icon" />';
$HTMLHeaderFmt['rss'] = '<link rel="alternate" type="application/rss+xml" title="Rss All recent Changes" href="$ScriptUrl/Site/AllRecentChanges?action=rss" />';
$HTMLHeaderFmt['the-javascript'] = '<script> // the javascript code </script>';
<!--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 $MetaRobots = 'noindex,nofollow'; # disable the robots tag entirely $MetaRobots = '';
(:messages:)
markup. Commonly used for displaying messages with respect to editing pages.
$RecentChangesFmt['$SiteGroup.AllRecentChanges']
'* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'
. . .
). The two spaces separate two parts of the format: the first part doesn't change (e.g. a link to the changed page) and the second part does change (e.g. the date and author of the change). Upon saving a page, PmWiki removes a line that matches the first part and adds a line with the current format before the first line with 2 spaces. This way, any line without two consecutive spaces stays at the top of the recent changes page.
$RecentChangesFmt['$SiteGroup.AllRecentChanges'] = '* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; $RecentChangesFmt['$Group.RecentChanges'] = '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]';
$DraftRecentChangesFmt['$Group.RecentDraftChanges'] = '* [[{$Group}/{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]'; $DraftRecentChangesFmt['$Group.RecentChanges'] = '';
$RCLinesMax = 1000; # maintain at most 1000 recent changes
(:redirect:)
markup.
$PageRedirectFmt = '<p><i>redirected from $FullName</p>'; $PageRedirectFmt = '';
'item' => 'li|dt', 'list' => 'ul|ol|dl', 'div' => 'div', 'pre' => 'pre', 'img' => 'img', 'block' => 'p(?!\\sclass=)|div|ul|ol|dl|li|dt|pre|h[1-6]', 'p' => 'p(?!\\sclass=)'
* %apply=item red%Here is a red styled list item * This item would not be styled. |
|
$WikiPageCSSFmt = 'Site.LocalCSS'; # global Site.LocalCSS page
$WikiPageCSSFmt = '{$Group}.LocalCSS'; # per-group LocalCSS pages
'FarmPubDirUrl', 'PubDirUrl', 'Skin', 'action', 'SkinDirUrl'
.
$EnableSelfWikiPageCSS = 1; # Apply styles to the "wiki CSS page" itself
$PmTOC['Enable'] = 1; # Enable TOC; default is 0 (disabled).
(: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.
$MaxIncludes = 50; # default $MaxIncludes = 1000; # allow lots of includes $MaxIncludes = 0; # turn off includes
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.
skin.tmpl
and skin.php
files, as seen by the PmWiki program. It does not have to be publicly accessible.
.css
, .gif
, and other files which appear in the HTML code sent by PMWiki to the browser. This directory must be publicly accessible.
$SkinLibDirs = array( "./pub/skins/\$Skin" => "$PubDirUrl/skins/\$Skin", "$FarmD/pub/skins/\$Skin" => "$FarmPubDirUrl/skins/\$Skin");
<!--IncludeTemplate:...-->
directive. By default this directive is disabled. Setting it to 1 allows one level of inclusions, setting it to 2 allows included templates to include more templates. There can be up to 10 levels of inclusion. This variable can be defined either in local/config.php
or in pub/skins/skinname/skinname.php
(with SDV):# in config.php, allow one level of inclusions $SkinTemplateIncludeLevel = 1; # in skinname.php, allow 3 levels of inclusions SDV($GLOBALS['SkinTemplateIncludeLevel'], 3);
1
page URL will be ...wiki.php/Main/Main
, when set to 0
(default) it will be ...wiki.php?n=Main.Main
.
$EnableFixedUrlRedirect=0;
blocks the redirect, so that PmWiki continues processing with the adjusted page name rather than issuing the redirect.
$GroupHeaderFmt = '(:include {$Group}.GroupHeader self=0 basepage={*$FullName}:)(:nl:)';
action=print
. Default value is:
SDV($GroupPrintHeaderFmt,'(:include $Group.GroupPrintHeader basepage={*$FullName}:)(:nl:)');
$GroupFooterFmt = '(:nl:)(:include {$Group}.GroupFooter self=0 basepage={*$FullName}:)';
action=print
. Default value is:
SDV($GroupPrintFooterFmt,'(:nl:)(:include $Group.GroupPrintFooter basepage={*$FullName}:)');
# default $PageNotFoundHeaderFmt = 'HTTP/1.1 404 Not Found'; # return all pages as found $PageNotFoundHeaderFmt = 'HTTP/1.1 200 Ok';
$HTMLVSpace = '';
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 $HTMLVSpace = '';
statement in a skin.php
file, preceded by the statement global $HTMLVSpace;
.
(:linebreaks:)
in a page or in a GroupHeader. To enable line breaks, add to config.php
such a line:$
HTMLPNewline = '<br/>';
$
SimpleTableDefaultClassName = "wikisimpletable"; $EnableSimpleTableRowspan = 1;
# See recipe
$EnableSortable = 1; # Enable sortable tables
<td>
or <th>
cell in the output. Can contain references to $TableCellCount which holds the horizontal column number of the current cell.
<td>
or <th>
cell. Default is " align='%s'"
where %s will be replaced with 'center', 'left' or 'right'. For a valid HTML5 output you may want to change this in config.php
:$
TableCellAlignFmt = " class='%s'";<tr>
element in the output. Can contain references to $TableRowCount to give the absolute row number within the table, or $TableRowIndex to provide a repeating row index from 1 to $TableRowIndexMax.
# Give each row a unique CSS class based on row number (tr1, tr2, tr3, ... ) $TableRowAttrFmt = "class='tr\$TableRowCount'"; # Give each row alternating CSS classes (ti1, ti2, ti1, ti2, ti1, ... ) $TableRowIndexMax = 2; $TableRowAttrFmt = "class='ti\$TableRowIndex'";
# Set rows indexes as 1, 2, 3, 1, 2, 3, 1, 2, ... $TableRowIndexMax = 3;
valign='top'
attribute if there is no valign
attribute defined in the markup source. Setting this variable to 0 in config.php will prevent the automatic addition.
$EnableTableAutoValignTop = 0; # disable automatic valign='top' attr
?skin=
or ?setskin=
URL query to the wiki. See also $EnableAutoSkinList and Skins:SkinChange.
$TableCellAttrFmt = 'class=col\$TableCellCount';
TableRowAttrFmt = "class='row\$TableRowCount'";
$TableRowAttrFmt = "class='ind\$TableRowIndex'";
See also: Edit Variables
< I18n Variables | Variables | Link Variables >
This page may have a more recent version on pmwiki.org: PmWiki:LayoutVariables, and a talk page: PmWiki:LayoutVariables-Talk.