Changing the style according to article section or category

Discussion in Joomla! Forum: [1]

How much PHP can be put into this article? I don't see a way doing it without changing the template's code.

I think, it would be good to add a CSS-File named by the category or category-Id, that will be included by the PHP-Code.


IF the file /template/{templatename}/css/categories/{examplecategory}.css EXISTS

THEN include it into Document.

BenniP 10:40, 21 March 2009 (UTC)

Apologies if it's poor etiquitte to bring up oldish topics (i've been doing some lightweight dev work for a couple of years but this is my first venture into contributing to an open source project). Also never really used a wiki before (*brushes sand out of hair*). I'm just reading through the documentation and came across this which is something I think i'll need on my next couple of projects.

I agree that I can't see a way of doing this without changing some code somewhere (i.e. not possible just through the use of the admin area + and html+css).

As I currently try use something like minify to gzip the js + css it'd suit me better if the <body> was tagged with classes for the section and category so all css could be applied from one main css file.

So I'll try and look at both solutions.

If I can get my act together i'll have a play with it and then post a link to anything if I can get a reasonably easy (for the admin) working solution. I'll be trying to get involved in a bit of the 1.5 -> 1.6 code cleanup if I can (if i'm capable of doing it) too so I might mosey on over to the 1.6 group and see if they've had any requests to implement somethign like this?

If I haven't posted back within a week it's likely i've not done anything on it and probably won't get a chance.

--Matt Newman 11:24, 26 November 2009 (UTC)