$PageTemplateFmt
= "pub/skins/myskin/myskin.tmpl";
to your local/config.php file.
$PageTemplateFmt
to point to your new template file in local/config.php.
A template file is basically an HTML file that also contains variable substitutions (indicated by '$') and special directives embedded in HTML comments. Two of these special directives are required in the template file. The directive <!--PageText-->
belongs to the <body> section of the HTML document, and tells PmWiki where the main content of each wiki page should be placed. The other required directive is <!--HeaderText-->
, which goes somewhere in the <head> section of the HTML document.
Throughout the layout template, variables such as $PageUrl, $ScriptUrl
, $Group
, and $Title
are replaced with the URL of the current page, the base URL to the pmwiki.php script, the name of the current WikiGroup, and the title of the page being displayed. Other variables in the template are substituted with the values of the equivalent PHP global variables. Some other common sequences:
$Titlespaced - the title of the page with spaces between words $Groupspaced - the group of the page with spaces between wordsFinally, the template can contain other directives to output the contents of other pages, files on disk, or to call other PHP functions. The directive
<!--wiki:Main.SomePage-->
can be used to display the contents of Main.SomePage at some point within the layout. This is useful to create editable menus or sidebars from pages other than the one currently being displayed. Variable substitutions work here, so <!--wiki:$Group.SomePage-->
will display the contents of "SomePage" in the current WikiGroup. Multiple alternatives can also be specified, thus <!--wiki:$Group.SomePage Main.SomePage-->
displays the contents of SomePage in the current group, and if that page doesn't exist then Main.SomePage is used instead.
<< LocalCustomizations | PmWiki.DocumentationIndex | LayoutAdvanced >>