PmWiki /
LayoutBasics This page is obsolete and here for historical purposes (although it may still be useful) -- see PmWiki.SkinTemplates for the more recent version.
This page describes how a Wiki Administrator can customize the layout (headers and footers) that appear on PmWiki pages. Layouts are usually controlled by a "skin" stored in the pub/skins/ directory. A skin is a directory that contains a template file (something.tmpl) that defines the layout of pages, as well as any supporting CSS and graphic images needed for the layout. For example, PmWiki is distributed with a default skin called "pmwiki" that is stored in the pub/skins/pmwiki/ directory. This directory contains a .tmpl file that defines how pages should be displayed on the screen, as well as a CSS file and graphic image needed by the layout. If you want to change the layout, you basically have three options.
The basic steps for customizing a layout are to create/edit a skin as a subdirectory of pub/skins/, then set the $Skin variable to the name of your skins subdirectory. The information below will help you with these two steps. Modifying the "pmwiki" skinThe pmwiki skin (i.e., pub/skins/pmwiki/) is part of the PmWiki installation, so any changes you make to these files are likely to be overwritten when you upgrade. Thus, instead of editing the files directly, you should start by making a copy of the files in pub/skins/pmwiki/ into a new skins directory (say, pub/skins/xyzskin/). Once you've made a copy of the skin directory, you can then edit the .tmpl and other files in that directory. You then tell PmWiki to use the skin in pub/skins/xyzskin by setting $Skin = 'xyzskin';
in your local/config.php file. Skin template filesA 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 Throughout the layout template, variables such as $PageUrl, $SkinDirUrl - the url of the skin's directory $Namespaced - the name of the page with spaces between words $Groupspaced - the group of the page with spaces between words Finally, the template can contain other directives to output the contents of other pages, files on disk, or to call other PHP functions. The directive Category: Skins
This page may have a more recent version on pmwiki.org: PmWiki:LayoutBasics, and a talk page: PmWiki:LayoutBasics-Talk. |