[pmwiki-users] skin info wanted
Patrick R. Michaud
pmichaud at pobox.com
Sat Sep 23 12:32:21 CDT 2006
On Sat, Sep 23, 2006 at 06:37:06PM +0200, Roman wrote:
> >> 2
> >> Should there be only 1 skin .tmpl file
> >> in each skin directory?
> >
> >In a basic skin, yes. Fancier skins may have
> >multiple .tmpl files, in which case it's up to
> >a skin.php file to select the appropriate one to
> >use.
>
> That sounds good, I thought it's not possible. On my site, front page
> has different layout than other pages, so I defined two skins with
> different .tmpl files and duplicates of images and CSS files. You say
> that it is possible to have only one skin with more .tmpl files. Can
> you give us an example how to select particular tmpl file?
Inside the skin.php file, simply call LoadPageTemplate()
with the name of the .tmpl file to be loaded:
LoadPageTemplate($pagename, "$SkinDir/xyz.tmpl");
For example, a skin can specify a special template to be used
if the action is 'print':
if ($GLOBALS['action'] == 'print')
LoadPageTemplate($pagename, "$SkinDir/print.tmpl");
The skins code processes any skin.php file before loading any
templates. If there is no skin.php file, or if the skin.php
file doesn't load a template, then PmWiki falls back to looking
for a template with the same name of the skin, or a single .tmpl
file if it exists.
Pm
More information about the pmwiki-users
mailing list