I would like to see something I think could be labelled as "Contect Aware Stylesheets".With this I mean, depending on the content or the taxonomy items (or better, combination of taxonomy items), send a specific stylesheet with the page the user is requesting.

With this one can add a green looking page when requesting a node posted at chtismas time, sent a specific logo when a specific (combination of) taxonomy was selected or change the layout per poster.

Another example, posting on drupal that are for mangers can be blue (stylefull) and postings for developers have a nice playfull logo.

What do think, is this something usefull?

Comments

beate_r’s picture

Version: » 4.6.0

Please let me comment on this - i am in need of exactly this feature for my curent project. Assume a personal site with a big information section organized ien commented books or the like. These books, possibly each of them, should have their own theme - every detail of a page layout starting from properties of the body tag (e.g., and especially background color, background image) should be modifyable, preferrably using CSS.

As i am using a custom theme based on the chameleon engine i seem to need to load a further CSS file after the site specific one in all the "special" pages, don't i?

What i would like to avoid is the possible workaround to use a multisite setup with a shared database - it will become cumbersome to reliably get back to the original layout when you leave the section with the special formatting.

best regards

Michael

magico’s picture

Maybe this module http://drupal.org/project/sections will help, or your feature can be implemented in it.

factoryjoe’s picture

You might also consider using CSS' built-in specificity design to achieve what you want. If you look at CivicSpace's website, I've made different sections look the way they simply by adding a class to the body tag. From there, you can restyle everything beneath by overriding the default styles via the cascade.

For a more detailed discussion of this approach, check out this slideshow by Doug Bowman.

beate_r’s picture

Thanks for the hints. Please let me add a few comments after a quick evaluation:

The idea of adding a class to the body tag will probably be sufficient for my needs. Its major drawback is that i have to modify the php part of the chameleon theme. Although this is easy, i would like to avoid it, simply because i do not like to maintain customized variants of official drupal code.
And giving it back to the community? Mhmm, they did not show any interest to the patch i already published to the chameleon engine which makes it possible to mirror a chameleon themed drupal site into a set of static pages, so what shall i expect?
Nevertheless, my opinion is that chameleon needs to be enhanced to add css classes and/or ids
to almost any tag it writes out.

The section module: looks very promising as well, even with regards to better organisation of my contents. It is CVS, I´ll try if it works in plain 4.6.0 ASAP.

Once again, thanks for these two helpful suggestions.

Michael

bertboerland’s picture

see also this thread

bertboerland’s picture

Status: Active » Fixed

there is a way of doing it, not for the nextnextfinsih people but not TOO hard, see http://drupal.org/node/26807

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Anonymous’s picture

Status: Fixed » Closed (fixed)