[pmwiki-users] Skin-specific Wiki Pages

Patrick R. Michaud pmichaud at pobox.com
Sat Aug 19 22:46:32 CDT 2006


On Sun, Aug 20, 2006 at 09:08:35AM +1000, Kathryn Andersen wrote:
> On Sat, Aug 19, 2006 at 03:53:23PM -0700, Andrew Standfield wrote:
> > If I wrote a .tmpl page to have a part in it that said something like  
> > <!--wiki:Site.NonStandardPage--> how do I supply Site.NonStandardPage  
> > to the end user? Where do I put it in the directory I give to them?

Kathryn gives the correct answer, which is to create a special
"wikilib.d" directory in the skin directory, and then have
the skin.php add the code:

    ## automatic loading of skin default config pages
    global $WikiLibDirs, $SkinDir;
      $where = count($WikiLibDirs);
      if ($where>1) $where--;
      array_splice($WikiLibDirs, $where, 0, 
          array(new PageStore("$SkinDir/wikilib.d/\$FullName")));

Essentially what this is doing is to insert the skin's
wikilib.d/ directory into the set of directories to be searched
for page files.  What's more, it puts the skin's wikilib.d just 
*before* the default wikilib.d/, so that pages in the skin's wikilib.d/
will override same-named pages from the PmWiki default distribution.

This information is officially available in the "Skin-specific Wiki Pages" 
section of http://www.pmwiki.org/wiki/Cookbook/SkinGuidelines.
However, that page looks a bit lengthy, so I can understand why
it'd be hard to find.  Perhaps the page could use some refactoring
and or code cleanup if anyone would care to work on it a bit.  :-)

Thanks!

Pm




More information about the pmwiki-users mailing list