[Pmwiki-users] skins in v1+

Knut Alboldt pmwiki
Sat Nov 27 05:39:19 CST 2004


At 00:46 27.11.2004, you wrote:
>My timing must be terrible...
>I rarely do any significant changes...
>But over the past week I've been trying to 1) move to wiki farming, and 2) 
>change to the Lean Skin.
>
>But as I work on it, I'm finding A) pmwiki.org is changing versions and no 
>longer allowing/supporting information about the collection of skins that 
>were there a few days ago, and B) that a modification of the farm wiki 
>skin doesn't automatically render that skin in the field, and C) trying to 
>point to the skin in the config doesn't work... or I'm not doing it 
>right... and the documentation isn't at pmwiki.org anymore
>
>(understandably so, because a quick glance at RecentChanges shows that 
>we're in transition between v1 &2)
>
>Personally, I prefer to wait for official releases before installing 
>upgraded versions.
>
>Can anyone clarify what is the method of installing a skin in a field for 
>version 1+?  Is it possible?  Thanks.
>

well I implemented in an own way in my config-scripts. There may be a 
better way - I don't know (but I won't change it because of migration to 
v2). Maybe it helps you:

I build up the field structure like this:

wiki\    = all wiki files
wiki\fieldname \  = wiki data and config files for a wiki field (I've got 4 
at the moment), so one filed-dir for each field
wiki\pmwiki.1.0.11\  = wiki basic installation files

ok lets start:

each wiki\fieldname\index.php looks like:

<?php

   $FarmFieldName = basename(dirname(__FILE__));
   require_once('../pmwiki1.incphp');

?>

so you display a wiki-field by the url http:://yoursite/wiki/fieldname
wiki/pmwiki1.php simply sets some common logging and debugging stuff and 
call of main pmwiki-script:

   require_once("pmwiki.1.0.11/pmwiki.php");

"htdocs/wiki/pmwiki.1.0.11/pmwiki.php" calls 
"pmwiki.1.0.11/local/farmconfig.php"

"htdocs/wiki/pmwiki.1.0.11/local/farmconfig.php" sets up some global var I 
use for wikifarming and then calls
"htdocs/wiki/$fieldname/local/config.php" and after that sets some skin vars:

--- farmconfig.php: ---

$wikibaseurl   = "/wiki";

$FarmPubDir    = "$FarmD/local/pub";
$FarmPubUrl    = "$wikibaseurl/$pmwikipgmdir/local/pub";

$PmwikiPubDir  = "$FarmD/pub";
$PmwikiPubUrl  = "$wikibaseurl/$pmwikipgmdir/pub";

$FarmSkinDir   = "$FarmPubDir/skins";
$FarmSkinUrl   = "$FarmPubUrl/skins";

$FarmFieldDir  = "$wikibasedir/$FarmFieldName";
$FarmFieldUrl  = "$wikibaseurl/$FarmFieldName";

$WikiDir = "$FarmFieldDir/wiki.d";

require_once("$FarmFieldDir/local/config.php"); # call farmfield specific 
setups

$EnableLocalConfig = 0; # forget all other local config-files

....

if (isset($WikiSkin)) # use user specific skin
{
   $SkinDir         = "$FarmSkinDir/$WikiSkin";
   $SkinUrl         = "$FarmSkinUrl/$WikiSkin";
   $PageTemplateFmt = "$SkinDir/screen.tmpl";
}
else # use pmwiki default skin (with other filenames)
{
   $SkinDir         = "$FarmD/pub/skins/pmwiki";
   $SkinUrl         = "$FarmPubUrl/skins/pmwiki";
   $PageTemplateFmt = '$SkinDir/pmwiki.tmpl';
}


in "wiki/fieldnamelocal/config.php" I setup the fieldspecific parts like:

   # customize the following for individual wiki farm fields

   $WikiName       = "Athome";
   $WikiTitle      = "local Knut's Wiki at home";
   $WikiSkin       = 'kwiki';

in the pub/skins/$wikiskin/ the skin-files are exspected if wikiskin is set 
otherwise the /pub/pmwiki/ skin-files are used.
When using my own skins I use screen.tmpl for page-display, print.tmpl for 
printing and publish.tmpl for publishing (all in the 
pub/skin/$wikiskin/-directory. all tmpl-files will use a correspondend 
css-file (e.g. screen.tmpl uses screen.css etc).
so chaning different skins is quite easy by copying the complete skin-dir 
with another name, setting $wikiskin and then changing the css and tmpl-files.

>Matt Simpson
><mailto:matt at undertheoak.net>matt at undertheoak.net
>--
>Pmwiki-users mailing list
>Pmwiki-users at pmichaud.com
>http://pmichaud.com/mailman/listinfo/pmwiki-users_pmichaud.com




More information about the pmwiki-users mailing list