[Pmwiki-users] pmwiki2 beta10 fresh installation + upgrade

Patrick R. Michaud pmichaud
Thu Dec 16 20:04:45 CST 2004

On Thu, Dec 16, 2004 at 10:43:24PM +0100, Knut Alboldt wrote:
> my existing wikifarm with own skins I could not migrate - so I have to 
> switch back to devel26.

My sincere apologies for the difficulties -- it's one of the hazards of
dealing with the devel series -- sometimes things change dramatically.
If it helps any, now that we're in the beta sequence there shouldn't
be any major changes in the structure prior to official release...

Now let's see about cleaning things up for you.  :-)

> $PageSkinFmt   = 'myskin';
> $PrintSkinFmt  = "$PageSkinFmt/print.tmpl";
> if ($action == 'print' & preg_match('/^Notes\./',$pagename))
>   { $PrintSkinFmt = "$PageSkinFmt/Notes.tmpl"; } # same for fax etc
> Now I don't know how to implement all this within beta10. 

Essentially in the config.php you'll want to set:

    $Skin = 'myskin';
    $ActionSkin['print'] = 'myskin';

and let the rest of the decision making take place in 

   global $action, $pagename;

   if ($action == 'print') {
     $grouptmpl = FmtPageName('$SkinDir/$Group.tmpl', $pagename);
     if (file_exists($grouptmpl)) LoadPageTemplate($pagename, $grouptmpl);
     else LoadPageTemplate($pagename, '$SkinDir/print.tmpl');

   LoadPageTemplate($pagename, '$SkinDir/screen.tmpl');

> I definetly don't 
> want to change the "screen.tmpl" and "screen.css" to "$skin.tmpl" and 
> "$skin.css" cause I set up almost 4 or 5 different skins and if I want to 
> create a new one I don't want to change the name of the files every time or 
> have to look which file to edit. At the moment I know I have to edit 
> screen.* for browsing, print.* for printing etc and that in all skins.

With ths approach you don't have to -- the skin.php file in each skin
directory will handle the selection of a screen.tmpl or print.tmpl
for you (based on the action).

> So I think scripts/skins.php is doing the job of tlayout.php now ?


> --- LayoutBasics ---
> Once you've made a copy of the skin directory, you can then edit the .tmpl 
> and other files in that directory. You then tell PmWiki to use the skin in 
> pub/skins/xyzskin by setting
>     $Skin = 'xyzskin';
> --- /LayoutBasics ---
> well: it's not enough to copy and change the tmpl-files. I also have to 
> rename them to the skin's name, don't I ?

Only if there's more than one tmpl file in the directory.  If there's
only one tmpl file, PmWiki uses it regardless of what it's named.


More information about the pmwiki-users mailing list