00139: Move the skin code

Summary: Move the skin code
Created: 2004-11-03 10:51
Status: Closed - added to 2.0.beta22
Category: Feature
Assigned:
Priority: 340
Version: 2.0.devel21
OS:

Description: There's no mechanism to set a skin from within a page. This could be allieviated by putting the section of code from scripts/tlayout.php into a function SetSkin() so that wikiadmins could call this from within their local customizations.

In pmwiki-2.0.devel21 it's lines 51-73 and the function would look something like this:

 
function SetSkin($skin) {
   global $SkinPathFmt, $SkinDirUrl, $PageSkinFmt, $SkinTmplFmt;
   global $FarmPubDirUrl, $FarmD, $PubDirUrl, $pagename;
   $PageSkinFmt = $skin;
   $SkinPathFmt = array(
     $PageSkinFmt => '',
     "pub/skins/$PageSkinFmt/$SkinTmplFmt" =>
       "$PubDirUrl/skins/$PageSkinFmt/$SkinTmplFmt",
     "pub/skins/$PageSkinFmt" =>
       "$PubDirUrl/skins/$PageSkinFmt",
     "$FarmD/pub/skins/$PageSkinFmt/$SkinTmplFmt" =>
       "$FarmPubDirUrl/skins/$PageSkinFmt/$SkinTmplFmt",
     "$FarmD/pub/skins/$PageSkinFmt" =>
       "$FarmPubDirUrl/skins/$PageSkinFmt");


   $f = 0;
   foreach($SkinPathFmt as $k=>$v) {
      $t = FmtPageName($k,$pagename);
      if (file_exists($t) && !is_dir($t)) {
         $SkinDirUrl = dirname(FmtPageName($v,$pagename));
         LoadPageTemplate($pagename,$t);
         $f = 1;
         break;
       }
   }
}

:-)


I looked at doing this today (4-Nov-2004) but it really makes a mess of things within PmWiki's current structure. There may be an argument that the logic of skins needs to change (again!), but I'm not quite ready to tackle that yet again. So, I'm suspending this one for the time being. --Pm


Nov 04/04
Doh, I was just looking for this feature myself - found it in PITS while doing a search. I too wanted to test out a bunch of different skins simply, like in PmWiki version 1. (Example: http://www.mydomain.com/pmwiki/pmwiki.php?skin=skin2 or http://www.mydomain.com/pmwiki/pmwiki.php?setskin=skin3). I'm pretty sure these features were available in PmWiki version 1. I anxiously await their implimentation in version 2. --Steven Leite


I'm a bit worried about requests like this. pmwiki isn't a wysiwyg editing tool, pmwiki is a content-focused tool that concentrates on producing content.

Adding the facility to specify -at a page level- which skin is used is very naive. It should either be up to the *reader* of a page to decide which skin they want to view the site with, not the author. If skinning for some reason is necessary, then the skin should be applied to a group of pages, but never at the page level.

Recently, a mailing list post suggested switching from semantic markup (e.g. emphasis) to deprecated italics tags. This isn't a good thing.

Focus on the content, not on how you want a page to look!