[Pmwiki-users] Skins, revisited

Knut Alboldt pmwiki
Fri Oct 29 17:24:48 CDT 2004


At 22:09 29.10.2004, you wrote:
>Okay, I think I finally have a handle on skin configuration--here's what
>I've ended up with for 2.0.devel20.
>
>The variables for controlling page display are $PageSkinFmt and $PrintSkinFmt.
>$PageTemplateFmt and $PrintTemplateFmt are deprecated, but will continue to
>be supported for the forseeable future.
>
>$PageSkinFmt can be any of the following:

1.

>    - the name of a directory in pub/skins/ containing a screen.tmpl template

2.

>    - the name of a template file relative to pub/skins/

3.

>    - the name of a template file relative to the current directory (acts
>      the same as $PageTemplateFmt in 1.x).

I guess with "pub/skins" you mean "$pmwikidirpub/skins" and not the current 
one.
How do you distingish if it's 2 or 3 ? Is it the sequence of dirs above the 
sequence the skin is searched ?

>Thus, if pub/skins/myskin/ contains the files for the desired skin, then
>one can set:
>
>$PageSkinFmt='myskin';                # uses 'pub/skins/myskin/screen.tmpl'

again: if myskin/screen.tmpl isn't  found in 1. will it be searched in 3. 
(currentdir/myskin/screen.tmpl) ?

>$PageSkinFmt='myskin/screen.tmpl';    # same thing
>$PageSkinFmt='myskin/blue.tmpl';      # use 'pub/skins/myskin/blue.tmpl'

maybe some more examples would clarify this

>Within a template, the variable $SkinDirUrl is set to be the url of
>the directory containing the template (assuming that $PubDirUrl has
>been correctly set).  Thus, a template file can specify something like
>'$SkinDirUrl/myskin.css' to refer to the myskin.css file in the same
>URL location/directory as the template.
>
>Similar rules hold for $PrintSkinFmt, except that if a directory is
>specified it will look for a 'print.tmpl' file instead of 'screen.tmpl'.
>
>The result of this is that someone wanting to modify a skin can copy
>*either* the entire directory or just the individual template file to be
>modified, set $PageSkinFmt to the new directory or template file, and
>things "just work".

thats' s fine !


>Also, there's a bonus for people doing WikiFarms:  $PageSkinFmt looks in
>both the farm's and field's pub/skins/ directories for the template file,
>and sets $SkinDirUrl accordingly.  Thus a farm administrator can
>develop/install a set of common skins that are easily available to each
>of the wiki field administrators.

even better ! which sequence: first farm then field or vice versa ?


>Finally, cookbook skin authors can now provide skins that simply unpack
>into the sites pub/skins/ directory.  For example, if a cookbook skin
>has its template stored as fancyskin/screen.tmpl, then enabling the skin
>is as simple as
>
>     $PageSkinFmt = 'fancyskin';
>
>in config.php.
>
>Comments, questions, suggestions welcome.  This feature will be released
>in 2.0.devel20.
>
>Pm

in docs the definition of pub/skins should made be very clear (as I wrote 
before I guess it's in the pmwiki-installation dir ?)

But all in all I think it's a flexible solution and easy to handle.

(I'm waiting for devel20 to clean up my config's :-)

Knut 




More information about the pmwiki-users mailing list