[Pmwiki-users] Skins, revisited

Patrick R. Michaud pmichaud
Fri Oct 29 22:36:52 CDT 2004


On Fri, Oct 29, 2004 at 02:18:58PM -0700, Steven Leite wrote:
> Some comments about skin usage in general:
> 
> 1.  The admin can create folders (of Group or Page names) in the skins
> folder,(eg.  pub/skins/Main/Main.tmpl, or
> pub/skins/Main/SandBox/SandBox.tmpl) where they are "automatically" used
> by PmWiki (no modifications needed to the config.php file.

This is not the common case for most sites, which want multiple 
groups/pages to share a common template.  However, it can
be done in 2.0.devel20 with just four lines of code:

if (file_exists(FmtPageName('pub/skins/$Group/$Name/$Name.tmpl',$pagename)))
   $PageSkinFmt = '$Group/$Name/$Name.tmpl';
else if (file_exists(FmtPageName('pub/skins/$Group/$Group.tmpl',$pagename))) 
   $PageSkinFmt = '$Group/$Group.tmpl';

> 2.  The user can specify a skin in the url:  via skin=fancyskin or
> setskin=fancyskin (where skin= is a one-time usage of the skin for a
> particular page, and setskin= permanently sets the skin until it is
> reset or set to something different.  Resetting would just be a matter
> of setskin= with no argument).

This is going to be offered as a cookbook capability, same as in v1.  
It definitely shouldn't be a feature enabled by default.

> I'm wondering if any of the changes proposed below will work for or
> against what I've described above.  I got lost in all the different
> variable names and don't understand why we need so many $Variables to
> handle skins (although, I'm sure there's a good reason for it) :-)

There are really only four variables now:

   $PageSkinFmt -- the skin used to display pages
   $PrintSkinFmt -- the skin used for "?action=print"
   $PubDirUrl -- the url of the pub/ directory (computed from $ScriptUrl)
   $SkinDirUrl -- the url of the skin's directory in pub/skins/ 
      (computed from $PubDirUrl and the skin being used)

Pm



More information about the pmwiki-users mailing list