[pmwiki-users] Re: Trouble with PageTemplateFmt overwriting PrintTemplateFmt since switching to 2.0.

Patrick R. Michaud pmichaud at pobox.com
Thu Sep 15 14:32:21 CDT 2005


On Thu, Sep 15, 2005 at 01:21:55PM -0600, Doyce Testerman wrote:
> > $PageTemplateFmt = "pub/skins/local/default.tmpl";
> > $PrintTemplateFmt = 'pub/skins/print/print.tmpl';
> 
> And of course, I immediate located this in the archives:
> 
> "Setting $PageTemplateFmt means "use this skin no matter what.""
> 
> ... which explains the behavior.  The problem is that I can't use 
> 
> $Skin = 'local/default.tmpl';
> 
> ... to define the tmpl file, and I can't simply point at:
> 
> $Skin = 'local';
> 
> ... since have have 14 different .tmpl files in that directory.
> 
> Is there a solution here other than setting up 14 skin directories
> under the /skins/ for the various groups I'm running in this wiki?

Yes.  In your pub/skins/local/ directory, create a file called
'skin.php', and set it to:

    <?php if (!defined('PmWiki')) exit();

    SDV($LocalTemplate, 'default.tmpl');
    LoadTemplate("$SkinDir/$LocalTemplate");

In your config, just set:

    $Skin = 'local';

With this setting, the local skin will always default to
"default.tmpl" in pub/skins/local/.  However, if a per-page or
per-group customization wants to change the template being used,
it can do

    $LocalTemplate = 'other.tmpl';

which will tell the skin to use a template file other than
the one set by the SDV() statement above.

Hope this helps!

Pm




More information about the pmwiki-users mailing list