[Pmwiki-users] Per Group/Per Page CSS?

Jeroen Coumans jeroen
Fri Jul 30 06:21:38 CDT 2004


Ciaran said the following on 30-07-2004 08:57:
> Hi, I thought I could create per group or per page CSS scripts.  If so
> where do I put them ? I've created a 'Testgroup.css' file for testing
> with a Testgroup/HomePage page and it seems to have no effect :( I've
> tried putting it in pub/css and pub/css/skins/lean (lean is the skin
> I'm using) Is this right ? [note, the css does not appear in the list
> of includes on the generated html]
> Any ideas ! :)

That's possible if you give your pages id's and classes based on their 
title and group. In your pmwiki.tmpl, change the <body> tag to this:

<body id="$Title" class="$Group">

Then in your CSS, you can target individual pages like this:
body#Title [HTML element] { any CSS rules}

And you can target groups like this:
body.Group [HTML element] { CSS rules}

Using this technique, you only need 1 template and 1 stylesheet. Good luck!

PS feel free to turn this into a Cookbook page (as long as you credit me 
;-))

-- 
Groeten/Greetings,
Jeroen Coumans
www.jeroencoumans.nl



More information about the pmwiki-users mailing list