PmWiki /
Layout Variables< 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:This array is used to override the current skin when performing a given action. The most common use is to set @@$ActionSkin['print']='foo'
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" />'; :$HTMLFooterFmt:Like $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 :$MetaRobots:Sets the value of the # never index this site
The key of the array specifies the page where changes will be logged, as in
$RecentChangesFmt['$SiteGroup.AllRecentChanges'] The value of the array specifies the format in which the changes will be logged, as in
'* [[{$Group}.{$Name}]] . . . $CurrentTime $[by] $AuthorLink: [=$ChangeSummary=]' Note the two consecutive spaces before the three dots ( . . . ). 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.
You can use and adapt the following to change the format (put it in config.php):
$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.
:$RecentUploadsFmt:An array specifying the format for uploaded files at the RecentChanges listing. It is similar to $RecentChangesFmt. If enabled, newly uploaded files will be logged to the RecentChanges pages. Default is disabled. See Cookbook:RecentUploadsLog for more information.
$RecentChangesFmt is set to $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'] = '';
For display options, see also the FAQ on PageDirectives.
'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=)' This defines that we can apply wiki styling on:
An example of applying scope to an LI element is below. For more information refer to WikiStyle scopes.
You can add additional HTML elements to $WikiStyleApply to apply wiki styles to other HTML elements. For example to allow styling on table rows, or anchor tags.
:$MaxIncludes:Controls the number of times that pages can be included via the
:$Skin:Lists the name(s) of skins to load, unless overridden by $ActionSkin. Normally $Skin contains a single string which is a the name of a skin directory, but it may also be an array of names, in which case the first skin found from the list is used.
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 $SkinLibDirs 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.
:$EnableFixedUrlRedirect:When PmWiki is given a partial page name (e.g., just the name of a WikiGroup), it uses $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
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. $PageNotFoundHeaderFmt MUST be set to return 200 as described above in order to get the expected behaviour with all browsers.
:$HTMLPNewline:This variable allows to enable linebreaks by default, i.e. without having the directive (:linebreaks:) in a page or in a GroupHeader. To enable line breaks, add to config.php such a line: :$TableCellAttrFmt:For [[Tables]], defines the HTML attributes given to each @@<td>@@ or @@<th>@@ cell in the output. Can contain references to $TableCellCount which holds the horizontal column number of the current cell. :$TableCellAlignFmt:For [[Tables]], defines the HTML attributes for alignment of each @@<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: :$TableRowAttrFmt:For [[Tables]], defines the HTML attributes given to each @@<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:The maximum value for $TableRowIndex in Tables. # Set rows indexes as 1, 2, 3, 1, 2, 3, 1, 2, ...
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. |