Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 UTC on 18 March 2024, to get $100 off your ticket.
Currently, it's impossible to create a legend based on taxonomy terms if they are referred to by using an entity reference field (instead of a term reference field).
Adding support for entity reference also allows to create the striping/legend based on other entity types (as long as there are not too much entities that can be referenced by the field).
Comment | File | Size | Author |
---|---|---|---|
#2 | 2040785-calendar-legend-entityreference-2.patch | 7.76 KB | Stevel |
Comments
Comment #1
Stevel CreditAttribution: Stevel commentedComment #2
Stevel CreditAttribution: Stevel commentedAdded a comment, some code style fixes, Added a check_plain().
Comment #3
BWPanda CreditAttribution: BWPanda commentedThis is awesome! It worked perfectly to allow me to colour nodes with different taxonomy terms referenced via entity_reference.
Comment #4
abx CreditAttribution: abx commented#2 work for me
Thanks
Comment #5
pbcelery CreditAttribution: pbcelery commentedAny documentation possible with patch? I'm not having success with a taxonomy legend using the referenced node's terms.
My trial, for reservations, keelboats, and keelboat's terms-
I'm not having luck using the relationship or terms for a legend though. Thanks for any advice.
Comment #6
Stevel CreditAttribution: Stevel commented@pbcelery:
I Assume the field 'keelboat_terms' is an Entity Reference field here.
After adding the field:
I think you need to save and re-open the Calendar Entities Settings page between step 2 and 3 or between step 3 and 4.
Comment #7
pbcelery CreditAttribution: pbcelery commentedI'll try it - many thanks.
Comment #8
afranioce CreditAttribution: afranioce commented+1
Comment #9
fizk CreditAttribution: fizk commentedThe Drupal-core Form API doesn't provide "#dependency", that seems to come from a contrib module like Form Dependencies.
We should rewrite this patch to use #states.
Comment #10
Stevel CreditAttribution: Stevel commented@fizk: I got the #dependency from the code that already exists in the module now: it is also used in the other legend options (taxonomy, og, ...).
It seems to come from ctools. See http://www.drupalcontrib.org/api/drupal/contributions!ctools!includes!de...
Comment #11
Stevel CreditAttribution: Stevel commentedBack to needs review
Comment #12
fizk CreditAttribution: fizk commentedThanks Stevel. Setting back to RTBC.
Comment #13
rmoss CreditAttribution: rmoss commentedjust like to say thanks for the patch!
...I was trying to use/learn calendar and also had a tax entry using entity references and at first couldn't figure out why I couldn't find it in the legend headings.
anyway, thanks again!
Comment #14
Neslee Canil Pinto