1

I'm working on a calendar view to show employees' vacation. For that I setup 2 content types:
-Employee: Name and Department (Term reference to 'Department' vocabulary)
-Vacation: Date field with start and end dates and Employee (Node reference to Employee content type)

I got views to show the calendar with vacation time for the employees, but I want to colorcode them based on the department their in. So I setup the relationship to the Employee content type and added the Department field using that relationship.

Views recognised the term reference field and allows me to set colors for each vocabulary term. Everything looks ok, except the actual calendar view which doesn't show any color at all. There is no "stripe" keyword in the html source.

To test I added a dummy term reference field to my Vacation content type itself to test the behaviour without a relationship and everything works as expected.

So it seems the colorcoding doesn't work on term reference fields via relationships. I could add the department reference field to my Vacation content type, but that would mean have the same reference in both the Employee and Vacation content types, which isn't something I'd like to have.

Has anyone come across this problem or better yet, solved it? Thanks in advance.

I'm running:
Drupal 7.14
Calendar 7.x-3.4+0-dev
Date 7.x-2.5+15-dev
Views 7.x-3.3+175-dev
Chaos tools 7.x-1.0+32-dev

1

Try the fullcalendar module if you want to color-code calendar views.

It's also handy because you can display a legend in an autogenerated block that helps users figure out what each color represents, etc. It's also a good solution because colors are easy to change/update via the admin configuration page.

  • Thanks for the tip. Unfortunatly Fullcalendar has the same problem. It doesn't take taxonomy fields from referenced nodes into account. – aweizd Jul 3 '12 at 11:08
  • Ah yes, you're right. Have you seen this module issue: drupal.org/node/1556676. – Boriana Ditcheva Jul 3 '12 at 17:04
  • I tested the patch and it doesn't seem to fix the problem. – aweizd Jul 4 '12 at 12:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.