I've been customizing the chameleon theme (cvs) for a while now but would ask for some input. One of my goals is to introduce custom css styles that are able to be controlled via the theme admin interface. Right now I've got specific formatting for node types and date down. I use it on the site http://coacalina.org. Basically when nodes are output there is a corresponding div tag based on it's type and it's 'freshness' - if it's a week, two, three, or six weeks old. For example a new page would have this tag:
<div class="fresh page entry">
<h2>page title</h2>
<p>this is the page i created</p>
</div>
The 'fresh' is a new post, the 'page' is the node type, and the 'entry' is a default setting that all nodes fall under. 'Entry' is good because if nothing else is specified then it goes to a default style, otherwise it's overridden by 'fresh' and 'page'. On coacalina.org different freshness settings change the background transparent gif so that older posts are darker than newer ones. Since it's an overall style for the contained information anything within could be specified with a corresponding css style, ie- links could be red for new links, grey for older ones, different backgrounds could be employed. So 'fresh' pages is different from 'ripe' page, and fresh 'page' is different from fresh 'story.
This whole time I've been used to thinking of it as a theme thing, that is - something that would be specific to the theme/engine but as I read more about theme hooks and look at how other themes are created I am wondering,is it more useful as a module? I would like it to be useful to the most drupal users and by limiting it to a theme or engine it's already limited.
Ultimately I'd like to accomplish the style by user, style by section, style by date issues so that people can customize different places on their website but use the same drupal installation. I'd like to have toggles in an administration setting (either in the theme or in a module) to turn on or off a div tag. For example you could go to settings and check 'generate node type tag' and it would add the appropriate text to the div tag. Obviously it would be up to the admin to add the appropriate css information as drupal does not (as of yet) have the ability to create .css files.
So back to the question: Could this be done with a module or can the appropriate div tag info only be created for a specific theme?
here's some code for what i've done:
<?
// i added a small section to the beginning...
// this is a measure of how many weeks old something is.
$week_made = date("W",$node->created);
$current_week = date("W");
$content_type = $node->type;
$comment_freshness = date("W",$node->changed);
if($current_week == $week_made) $freshness .= "fresh";
elseif($current_week - 1 == $week_made) $freshness .= "recent";
elseif($current_week - 2 == $week_made) $freshness .= "ripe";
elseif($current_week - 3 == $week_made) $freshness .= "aged";
elseif($current_week - 6 <= $week_made) $freshness .= "old";
elseif ($current_week >= $week_made) $freshness = "old";
//end freshness
?>