Adding separate Striping / legend colors per field would be a nice feature.

Use case:
My nodes have 2 date fields, deadline-date and publication-date.
Using the CONTEXTUAL FILTERS and checking both fields generates 2 Calendar Entities nicely, but both have the same color.
Now it is not clear which meaning each date has.

Comments

Title:Add Striping bases on FieldAdd Stripe / Legend based on Field_name

cross-posting:
this issue has the same question for new striping aglorithms: #486794: Possible to add other fields to Legend?

I created a patch for this, which is included in #1392306: Code cleanup for striping

Status:Active» Closed (duplicate)

#1392306: Code cleanup for striping has a patch so this is a duplicate.

Status:Closed (duplicate)» Active

The new stripe feature got removed from that patch, so re-opening this as a feature request. If you want to propose this, it needs its own patch.

Status:Active» Needs review
StatusFileSize
new6.63 KB

Please find my patch attached.

Discard the patch from #5. Attached a new version.

test, test, test

Status:Needs work» Needs review
StatusFileSize
new5.32 KB

Better version. #8 is OK.

Status:Needs review» Needs work

I tried this out but I'm having trouble getting this to do anything, or tell what it ought to be doing. It adds an option to use a date field and then gives me no place to select which date field to use. I just get a single textfield where I can set a color but I can't tell what that color will apply to and I can't set different colors for different fields.

OK I figured out that if I add a second date field I can give it a color. But if my date fields don't have labels I can't tell them apart (that's why I couldn't tell what the textfield was for). Also the stripe has no effect for me after I select a color.

So I guess this needs some work yet.

Status:Needs review» Needs work
StatusFileSize
new6.49 KB

The module changes of April 18 made some changes necessary.
Patch from #9 was not correct either. See attached new patch.

This functionality can be used for every Entity type that has +1 date fields, like a summer course:
- registration start date
- course start date

Some remarks regarding the patch:
- the last line of the patch removes a superfluous line of code.
- The changes of April 18 in theme.inc (function theme_calendar_stripe_legend) introduce some duplicated code. Is it an idea to move the " switch ($legend_type) {...}" part to calendar module, into a function calendar_get_optionlabels(&$display_handler, $legend_type) ?
The we can use this to remove duplicated code to determine the labels.

Status:Needs work» Needs review

Good patch, great idea, and it works well for me. Any chance of getting it committed?