[Pmwiki-users] Re: CSS links under 0.6.1 or later

Patrick R. Michaud pmichaud
Wed Mar 17 12:24:37 CST 2004


On Wed, Mar 17, 2004 at 07:56:54PM +0100, Albi Rebmann wrote:
> >>I would love to see this put back in place so that $HTMLHeaders 
> >>is automatically populated with stylesheets in the following 
> >>order if they exist in the /pub/css/ directory.
> >> 1) local.css
> >> 2) $Group.css
> >> 3) $Group.$Page.css
> >>This brings the main thing that makes PmWiki so easy to administer back.
> >Done, will be included in the next release.
> 
> Is that possible with tmpl files too?
> If yes, which folder do I have to use?

If you want to have .tmpl files be set up by group, try placing

   $PageTemplateFmt = 'pub/skins/$Group/$Group.tmpl';

in your config.php.  PmWiki will then look for template files in
pub/skins/<group>/<group>.tmpl .

Note that this doesn't "fall back" to using another template file
if it doesn't exist--if you want that functionality you need a bit
more logic:

   $TemplateListFmt = array('pub/skins/$PageName/$PageName.tmpl',
     'pub/skins/$Group/$Group.tmpl',
     'pub/skins/local/local.tmpl');

   foreach($TemplateListFmt as $t) {
     $tmplfile = FmtPageName($t,$pagename);
     if (file_exists($tmplfile)) { $PageTemplateFmt=$t; break; }
   }

which will use a per-page, per-group, or local template file
(and if none of these exist it uses the default template).

Pm



More information about the pmwiki-users mailing list