[Pmwiki-users] PmWiki skinning

Patrick R. Michaud pmichaud
Fri Nov 12 11:43:11 CST 2004


On Tue, Nov 09, 2004 at 02:21:19PM +1300, John Rankin wrote:
> I think it's too easy to over-complicate, rather than it being
> inherently complex. In my head, the question is very simple:
>     given a choice of skins, which do I use in the current context?

Alas, the answer to this question, "how does PmWiki find the correct
file(s) to use" is the complex part.

> Important subsidiary questions are:
>    how do I install and use a new skin?
>    how do I create a skin that others can easily install and use?

Also, "how do I build a new skin from an existing one?"

> Here are some thoughts.
> 1. what precisely is a skin?
>    It's a directory that contains at least one of the following
>    files
>        screen.tmpl
>        print.tmpl
>        skinx.tmpl
>        somefile.tmpl
>        skinx.css
>        skinx.php
>    where 'skinx' is the name of the directory
> 
>    So I think one thing we need is an easy way to tell PmWiki to
>    load pub/skins/skinx/skinx.php, if it exists.

One big problem I have with the above scheme is that if the skinx/
directory is renamed or copied to another name, then the admin has
to remember to also rename the skinx.php and perhaps the other skinx.* 
files as well.  Since copying/modifying existing skins is most common
for new administrators, I'd prefer to reduce the number of opportunities
for missteps here.

In many ways it comes down to deciding which rule is easier on new
admins--something like "always use 'skin.php' and 'skin.tmpl'"  
versus "be sure the .php and/or .tmpl files have the same name as 
the skin's directory".

> 2. action-specific skin settings
> [...]

After working out some of the details I think I'm in agreement with
the use of an $ActionSkin array.

> 3. do I need to know HTML and css?
>    This approach pretty much hides the complexity, I think.
>    The instructions for installing a new skin can become:
>        put the skinx/ directory into pub/skins/
>        add $Skins[] = 'skinx'; to local/config.php

Alas, for many new administrators exploring PmWiki for the first
time, the steps would end up being:
    copy or rename the pmwiki/ skin directory to skinx/
    rename the pmwiki.php and/or pmwiki.tmpl file in skinx/ to 
        skinx.php and/or skinx.tmpl (but don't rename the 
        pmwiki.css file(!), unless you also change it in skinx.tmpl)
    add $Skins[] = 'skinx'; to local/config.php

That second step is pretty messy.

Pm



More information about the pmwiki-users mailing list