Download & Extend

Add Stripe / Legend based on Field_name

Project:Calendar
Version:7.x-3.x-dev
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

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

#1

Title:Add Striping bases on Field» Add 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?

#2

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

#3

Status:active» closed (duplicate)

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

#4

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.

#5

Status:active» needs review

Please find my patch attached.

AttachmentSize
calendar_1394362_5_date_field_striping.patch 6.63 KB

#6

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

AttachmentSize
calendar_1394362_6_date_field_striping.patch.txt 5.71 KB

#7

#8

test, test, test

AttachmentSize
calendar_1394362_6_date_field_striping.patch 5.71 KB

#9

Better version. #8 is OK.

AttachmentSize
calendar_1394362_9_date_field_striping.patch 5.32 KB

#10

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.

#11

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.

#12

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.

AttachmentSize
calendar_1394362_12_datefield_striping.patch 6.49 KB

#13

Status:needs work» needs review

#14

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

nobody click here