[pmwiki-users] $PageCSSListFmt

Patrick R. Michaud pmichaud at pobox.com
Thu Sep 21 09:30:55 CDT 2006


On Wed, Sep 20, 2006 at 08:09:34PM -0500, JB wrote:
> $PageCSSListFmt is an array of a set of "key" => "value" pairs.
> 
> The key is a possible path to a file on disk holding the css data.
> The value is the coresponding URL for that file.
> 
> For each named file that exists, the browser is instructed to load the
> corresponding URL.
> 
> Why specify a hard disk file location and the url instead of just 
> the css file url like in HTML?
> 
>   <link rel="stylesheet" href="mystyle.css">
> 
> It only need one.  Why make this complicated?

Here's the use case that $PageCSSListFmt is intended to solve:

     A wiki administrator downloads and installs PmWiki, and also
     downloads and installs a skin from the Cookbook.  However, the
     administrator also needs some custom CSS to be loaded for
     the entire site, and also needs some additional CSS to be
     loaded only for pages in the XYZ group.

     Of course, the wiki administrator doesn't want to modify
     the PmWiki or skin distribution files, because that will
     make things difficult for upgrading later.

     To create the site-wide CSS, the administrator simply
     creates a file called pub/css/local.css .  PmWiki automatically
     detects that file and causes a stylesheet link for local.css
     to be included in the HTML <head> section of the document.

     For the per-group CSS, the administrator creates pub/css/XYZ.css .
     When a visitor views a page in the XYZ group, PmWiki automatically
     includes the stylesheet link to the XYZ.css in the <head> section.


In summary, what we want to do is make it easy for a wiki adminstrator to 
   - add custom CSS to the output
   - do this on a site-wide, per-group, or per-page basis,
   - without having to modify any distributed skin or PmWiki files

If you have a less complicated way to achive this, I'll be glad to hear it.

Pm




More information about the pmwiki-users mailing list