Each event for which colors are enabled should have CSS classes added per-taxonomy term, per-node type, and per-group, probably something like:
.node-type-[machine_name]
for node types.taxonomy-term-[tid]
for taxonomy terms.group-[gid]
for groups
For reference, here's the theme function for fullcalendar_classname (which gives classes to an individual event):
<?
/**
* Constructs CSS classes for a entity.
*
* @param $node
* An object representing the entity.
*
* @return
* A string suitable for use as a CSS class.
*/
function theme_fullcalendar_classname($variables) {
$entity = $variables['entity'];
$className = array(
'fc-event-default',
$entity->bundle,
);
return implode(' ', $className);
}
?>
Oh, and to tim.plunkett: Yes, installing a site with drush is oh-so-much better than doing things by hand!
Comment | File | Size | Author |
---|---|---|---|
#2 | fullcalendar-node-type-coloring.patch | 1.12 KB | aspilicious |
Comments
Comment #1
aspilicious CreditAttribution: aspilicious commentedAfter talking to Tim, I made a hook we can use :).
The patch for that will be pushed soon: http://drupal.org/node/1131028
After that one is in, we need to implement the hook (something like this)
Comment #2
aspilicious CreditAttribution: aspilicious commentedI made a prototype hook implementation to proove it is working.
We need more discussion about how we ware going to handle this.
Option 1
--------
Leave as it is and throw everything in the hook
Option 2
-------
Make a css color function for each type:
Something like this.
This option leaves the add css call in the hook
Option 3
--------
Same as 2 but it does almost everything that is happening in the hook at the moment, it will return an array of classes that needs to be merged with the classes from other types.
Option 4
---------
??? feel free to fill in
Comment #3
aspilicious CreditAttribution: aspilicious commentedComment #4
geerlingguy CreditAttribution: geerlingguy commentedI like option 2, as it seems to be the most maintainable/modularized (as we will hopefully add more entity types in the future, perhaps... like commerce products, etc.).
Comment #5
geerlingguy CreditAttribution: geerlingguy commentedThis was all fixed over in #1130092: Fixed farbtastic stuff.
Comment #6
tim.plunkett