This forum is for assistance with theme development.

css customized div tags: better as part of theme or as modules?

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
?>

Is Flash can run a php file in a drupal site?

Hi

I have made a template with a flash header and it's work fine. But now I wish to integrate a jukebox in it. I use a little php file write like that:

theme mods

anyone interested in paid work doing theme mods and css stuff to customise drupal installs? possible other projects such as custom mods etc for someone with the right skills. email jeremy@ozhome.net if you're interested.

specifying another stylesheet as well as style.css?

I'm customizing a new theme/engine using chameleon. I've taken a lesson from an early theme I used (I think it was phptemplate) where there were seperate style and structure css files. I did this a little differently, I wrote a base stylesheet that included all the overwrites necessary to get drupal.css controlled. Then I wrote a separate stylesheet for what amounts to a customized look.

To get both of these to work I simple commented out the code to call the theme engine for the stylesheets and put in specific path names.

Drupal button

Had some free time, so i created a custom drupal button, if anyone is interested. Get it here, http://www.students.ncl.ac.uk/r.k.machap/drupalpowered.png.

*Sorry if I posted this in the wrong place, not really sure where i should post this.

Drupal.org

Hi

What theme is drupal.org using? Is there a similar theme downloadable in here?
And if not. How do i make the round edges on the bloks?

/roma

Pages

Subscribe with RSS Subscribe to RSS - Theme development