I need the events to be coloured depending on the taxonomy term associated to them, rather than on the default random basis, which i feel is more confusing than helpful.

I've patched the event.theme file to do that, but it is a bit quick and dirty:
* if the node containing the event has more than one term associated to it, the first term found is always used.
* the color index is calculated as a modulo on the term id : tid % 10 + 1, so different terms may get the same colour if their ids are not contiguous or if they are more than 10.

But for a simple situation like mine, it does the job.
I post the patch here in any case it could be helpful to anyone, or be used as a basis to improve the module.

CommentFileSizeAuthor
event.theme__1.patch2.94 KBricflomag

Comments

nancydru’s picture

nancydru’s picture

So how can this be extended to the content type?

goose2000’s picture

Thanks, got the patch to work. I am dumbfounded that those colors had no purpose in the original design?

John

smcguinness’s picture

Could this be used for the non dev version?? Or, is the dev version stable enough for production?

sejtraav’s picture

Drupal Newbie here...
how do I use this patch?
thanks!

ricflomag’s picture

You might find this thread useful: http://drupal.org/node/34422

samirpancha’s picture

Hey I am using this as a patch for tracking leave...is there a way to give all the people with the same name the same color? As in when I type in an event for John...Johns color is always red?

Cause after installing the patch currently this doesnt happen.

japerry’s picture

Status: Needs work » Closed (outdated)

Event for Drupal 8 is unrelated to older versions. If an issue similar to this one exists, please open a new issue with the 8.x branch.