Running Drupal 7.7 with latest dev modules of calendar, views, ctools, & date -- trying to color code events based on taxonomy - I have a Taxonomy term relationship set up & a Taxonomy term: Term ID set up in "Fields". However, when I go to Format: Show: Taxonomy and select Taxonomy for Legend Colors it doesn't give me any option to select which taxonomy vocabulary I want it to filter with. I've read this link: http://drupal.org/node/1161632 but it doesn't seem to help.

I've added both a relationship filter, and the required Term ID field.

Thanks.

Comments

Category:bug» support

StatusFileSize
new116.81 KB

Im seeing the same thing also with the latest version of Drupal and the latest dev versions of Ctool, Views, Date and Calendar as of today. Screen cap included.

I must be missing something... any help would be appreciated.

Installed a clean install of D7.7 - dev versions of date, calendar, ctools and views that I downloaded yesterday. I am still seeing this issue. Here is what I am doing step by step.

1. Set up Drupal and turned on the 4 modules.
2. Added a "calendar" taxonomy and made a few terms in it.
3. Created an event type with a date field named "event date" with start and end dates and a Term Reference to my "calendar" taxonomy.
4. Created a clone of the view that came with calendar. Disabled the original
5. In the cloned view I added a Relationship to "Content: Taxonomy terms on node" and select my "calendar" vocabulary (save view)
6. I add the field "(term) Taxonomy term: Term ID" (save view)
7. go to the Format Show Calendar settings, select Legend Colors "Based on Taxonomy" and get "You must add a term field to this view to use taxonomy stripe values."

Any thoughts would be greatly appreciated.

Title:Taxonomy Vocabulary not DisplayingTaxonomy Vocabulary not Displaying (term field for stripe values)

Am I the only person who is seeing this problem? Anyone else successfully have striping working based on a taxonomy?

I have the same issue

StatusFileSize
new2.04 KB

I think the settings dialog is unclear here on the field that is needed. If you take a look in includes/calendar_plugin_row_node.inc:

    $vocab_field_options = array();
    $fields = $this->display->handler->get_option('fields');
    foreach ($fields as $name => $field) {
      if (!empty($field['type']) && $field['type'] == 'taxonomy_term_reference_link') {
        $vocab_field_options[$field['field']] = $field['field'];
      }
    }

The taxonomy term field you need here needs to be the one on the node itself, not the term ID from a taxonomy relationship. Also, the formatter on the field needs to be 'Link' (not 'Plain Text'). This should probably be more robust. With the right field, a dropdown should show in the settings dialog. But it pukes with an 'invalid hex color' error. I fix that in the patch, it appears to be an unneeded validation.

But you still don't get any options to set the legend colors. I also address that in the patch, and can set the colors successfully.

However, the stripes still don't actually show up in the view. I'm still trying to track that part down.

StatusFileSize
new2.49 KB

Figured it out. Incorrect array index further down in calendar_node_taxonomy_stripe. Working for me now. Complete patch attached.

Status:Active» Reviewed & tested by the community

I just updated to the dev version and applied this patch and it seems to work well.

The patch works well for me to. Hope this gets rolled into the new update. Thanks for your efforts.

I just gave this patch a try, and it corrects the problem.

I am having the same issues as described above but I am not familiar with applying patches. Is it possible to apply patches on a Godaddy install?

As this been committed yet to the latest Dev?

Tested #8 on the current dev release and it works like a charm. Thanks very much.

Status:Reviewed & tested by the community» Fixed

This looks good. Thanks for all the work! Committed today.

I'm currently in alpha 1, so the patch is not present for the moment, will you release a new alpha soon?
I would not like to put the dev version just to solve that bug :(
I tried to apply the patch on my alpha 1 but it doesn't work.

Thank you

I'm in the same boat as rayden here.

I have the issue described in #3, applied patch #8 manually to alpha1, but no success.

The only field I can add to the view is "Content: All taxonomy terms" - is this the right one?

--Edit: tried to include term fields (ID, name) too based on a taxonomy relationship, but that din't work either.

Status:Fixed» Active

Installed the dev version and it's still not working. i added all possible term fields.

Re-opening as support request. How do I set it up so I can assign colors to taxonomy terms?

Status:Active» Closed (fixed)

Updated Date module to latest dev too. Still doesn't work and I got this error on the views page:

    Notice: Undefined index: table in views_handler_field->add_additional_fields() (line 107 of /home/dann4049/public_html/subdomains/dorchester/sites/all/modules/views/handlers/views_handler_field.inc).
    SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'description' in field list is ambiguous
Status message
    Debug:
    'Handler views_handler_field_markup tried to add additional_field format but  could not be added!'
    in views_handler_field->add_additional_fields() (line 107 of /home/dann4049/public_html/subdomains/dorchester/sites/all/modules/views/handlers/views_handler_field.inc).
    Debug:
    'Handler views_handler_field_term_link_edit tried to add additional_field vocabulary_machine_name but taxonomy_vocabulary could not be added!'
    in views_handler_field->add_additional_fields() (line 107 of /home/dann4049/public_html/subdomains/dorchester/sites/all/modules/views/handlers/views_handler_field.inc).
    1317918774

Nevermind - I'm reverting everything.

For all who still have problems with this (as I have had before):

  1. Always use current dev-versions of calendar, date and views
  2. add a taxonomy term from your content type(s) to your fields. You do not need to use a relationship to the vocabulary!
  3. Set the output to be a link, not plain text.
  4. Click on Settings in the Format Show section. Here you can select the vocabulary to set the stripes on, but not yet the colors. Click Apply.
  5. Now click on the same Settings-link again. For each term of the vocabulary you can set a color now.

If you don't want the taxonomy to be output as a link you can set it to plain text now. If you want to change the behaviour in the Show-Settings again, you have to set the output back to a link.

But with the current css provided by the calendar module, the color of only one term is displayed per row, not the colors of all terms of the row (if there are more than one term in this content). Here is some css you can add to your theme to solve this problem:

/* Show the stripes one below the other (if there are more than one term) */
.calendar-calendar .day-view td .stripe,
.calendar-calendar .month-view .full td .stripe,
.calendar-calendar .week-view .full td .stripe
{
  position: relative;
}
/* move content back to top, as there could be more than one stripe now */
.calendar-calendar .month-view .full td.multi-day .calendar.monthview .contents,
.calendar-calendar .week-view .full td.multi-day .calendar.weekview .contents
{
  position: absolute;
  top: 0;
}
/* same for the continuation marker at the end */
.calendar-calendar .month-view .full td.multi-day .inner .monthview .continues,
.calendar-calendar .month-view .full td.multi-day .inner .monthview .cutoff,
.calendar-calendar .week-view .full td.multi-day .inner .weekview .continues,
.calendar-calendar .week-view .full td.multi-day .inner .weekview .cutoff
{
  top:0
}

If you want to color the stripes by css rather than by views, add a .stripe[title~=term name] for each term name of the vocabulary.

Hope that helps a bit.

I am using the latest dev versions of calendar, date and views and the legend colors, which are set in the view based on taxonomy terms, are not displayed. By way of comparison the legend colors based on content types are displayed correctly. Any hints?

I got exactly the same problem, it's possible to set the color as described above but the stripes are not displayed in the calendar. Got any solution? Thanks!

This issue seems to be fixed, as having the latest version of ctools, views, calendar & date have allowed me to choose which taxonomy I would like to use after adding the term reference field to the list of fields. There still seems to be a problem with selecting what the colors should be per taxonomy term. The patch at #1392306: Code cleanup for striping seems to have fixed this second issue.

I am having this issues, I am not using the Dev build, but should I really have to on a year old issue?

@HeathN - you shouldn't have to use Dev anymore, but that's the first step to troubleshoot the problem. Be sure to check out wbue's comment #20 for a list of things to check as well. Could you post what worked for you?

Yes, if you follow #20 then it will work. I think this issue is fixed now and can be closed

For any of you driven nuts by this issue... please let me help, as I just suffered.

My problem is that I was adding the field, Content: All taxonomy terms.

I had misinterpreted point 2 in #20 above:

2. add a taxonomy term from your content type(s) to your fields. You do not need to use a relationship to the vocabulary!

What I actually needed to add was: Content: Event Type where "Event type" was the field label that I gave to the taxonomy_term reference field that I had added to the content-type whose dates I'm displaying on the calendar.

I would have done better if I had seen something like term reference or anything to do with term in the Views field-picker. But the field picker in views was picking up the label from term reference field, which, in brain at least, didn't easily connect me to the taxonomy.

I would suggest that point 2 in #20 above be re-written:
2. Check on the label that you have assigned to your taxonomy term reference field that you have added to the content type for the dates you are displaying on the calendar. In View's field-picker screen, look for: "Content: " (replacing what is in the angled brackets with the label you assigned) and select it.

I hope this helps someone.

Issue summary:View changes

Thanks to comment #27 I got the stripes to show up.