[Pmwiki-users] skins

Patrick R. Michaud pmichaud
Sat Oct 23 00:57:36 CDT 2004


On Tue, Sep 21, 2004 at 11:34:01AM +0200, Knut Alboldt wrote:
> 
> But what do you think about the "naming"-standard of using one 
> template-name, e.g. /pub/skinname/display.tmpl for page display instead of 
> /pub/skinname/skinname.tmpl as well as for the referenced css-files. Then a 
> copy of an existing skin could be customized with less work.

Actually, after thinking about this a bit more (and helping a couple of
other users troubleshoot layouts) I've decided to try out a naming 
standard for skins in the pub/skins/ directory.  The new standard I'm 
looking at adopting for 2.0:

  - Each skin has its own directory in pub/skins/ (e.g., the "pmwiki" skin
    is in pub/skins/pmwiki/, while the "print" skin is in pub/skins/print/).

  - Within a skin directory, the template for screen displays goes in
    screen.tmpl, while the template for ?action=print goes in print.tmpl.

  - An administrator can easily select a skin by setting $PageSkinFmt
    (or $PrintSkinFmt) to the name of the directory holding the skin.
    For example, setting $PageSkinFmt="myskin" would cause PmWiki to
    use pub/skins/myskin/screen.tmpl as the display template.

  - PmWiki automatically sets $SkinDirUrl to be the URL for reaching
    the skin's directory (e.g., to access graphic or .css files).

  - $PageTemplateFmt and $PrintTemplateFmt work as in previous versions--
    if set then they explicitly name the file to be used as the template
    rather than have it automatically determined from $PageSkinFmt
    or $PrintSkinFmt (i.e., to select a template other than 
    screen.tmpl/print.tmpl).

Hopefully this will make things a lot simpler for building and 
distributing skins:

  - css files within a layout template can now be specified relative
    to the skin's directory

  - a skin can optionally provide both a screen and a print layout 
    (PmWiki then uses its default skins for any layout not provided)

  - distributing skins as cookbook scripts is greatly simplified
    and standardized

  - selecting a skin is much easier, as the administrator merely names 
    the skin to be used rather than having to specify a complete 
    on-disk path name to the template file (many new administrators
    assume a URL is needed).

The new skin directory structure appears in 2.0.devel16 (just about to be
released).  

Pm



More information about the pmwiki-users mailing list