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.
| Comment | File | Size | Author |
|---|---|---|---|
| event.theme__1.patch | 2.94 KB | ricflomag |
Comments
Comment #1
nancydrudup of http://drupal.org/node/148554
Comment #2
nancydruSo how can this be extended to the content type?
Comment #3
goose2000 commentedThanks, got the patch to work. I am dumbfounded that those colors had no purpose in the original design?
John
Comment #4
smcguinness commentedCould this be used for the non dev version?? Or, is the dev version stable enough for production?
Comment #5
sejtraav commentedDrupal Newbie here...
how do I use this patch?
thanks!
Comment #6
ricflomag commentedYou might find this thread useful: http://drupal.org/node/34422
Comment #7
samirpancha commentedHey 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.
Comment #8
japerryEvent 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.