Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hello there,
I have a an entity that has many date fields eg. Project start date, client meeting date etc etc. These all display on the calendar however when ever a date occurs the view shows every possible date entered for that entity.
I've attached an image as I'm probably not making much sense. Is there a way of only showing the relevant date per day? Eg the Client meeting date on the correct day without all the other fields...
Comment | File | Size | Author |
---|---|---|---|
Screenshot.png | 82.54 KB | tr33m4n |
Comments
Comment #1
arlinsandbulte CreditAttribution: arlinsandbulte commentedSo, each calendar entry is showing all date fields?
If so, you just need to edit the fields display in views to no include the fields you don't want to see.
Comment #2
tr33m4n CreditAttribution: tr33m4n commentedBut then the fields that aren't displayed would not show on the dates they appear surely?
Comment #3
arlinsandbulte CreditAttribution: arlinsandbulte commentedHmmm, I think I understand your use case.
Your nodes (or entities) represent a project with multiple date fields for different milestones of that project.
Calendar is configured to use each date field on the node (or entity) to show a sort of timeline of that project.
But, each time the node (or entity) is shown on the calendar, all date fields used are displayed. You only want the specific field for that particular date instance displayed.
I don't think what you want is natively possible with the calendar module, but it might make an interesting feature request.
A couple thoughts that might lead to a quick solution:
I think option #2 would be pretty easy to implement, AND provide some very nice workflow features if I understand your use case properly.
Comment #4
tr33m4n CreditAttribution: tr33m4n commentedYes, that's exactly what I want to achieve.
Any idea how to achieve number one on your list? I don't think number two would be possible due to the sheer amount of fields each node has.
I have a views display on the other end of things displaying nodes kind of like a spreadsheet with editable fields... Trying to do number two would possibly start damaging performance on that end as well :S
Thanks for the suggestions
Dan
Comment #5
tr33m4n CreditAttribution: tr33m4n commentedComment #6
johnvI have the exact request, and it works fine (on a month display). I have 3 date fields in a Node type.
- in contextual filters, I define 1 date field
- in Fields, I add 3 date fields and 2 other fields - every field shows in de Entity/Event
- in Fields, when I 'exclude' a date field or a normal field, the field do not show up in the Event.
Comment #7
arlinsandbulte CreditAttribution: arlinsandbulte commentedjohnv: tr33m4n wants to conditionally hide the fields not used to 'place' the node in the calendar view. I think that is different from what you describe.
Example:
A 'Project' Node type has 3 date fields (for example, node title = 'Project #1').
Date field #1 is project approved (for example, July 1, 2012).
Date field #2 is project started (for example, July 5, 2012).
Date field #3 is project ended (for example, July 10, 2012).
The Calendar view is configured to use all three date fields to place the project nodes on the calendar grid.
When our example node is placed on the calendar, it will show up 3 times on July 1, 5, & 10.
Each time it shows up, all three fields are shown:
This can be a bit confusing in this use case.
tr33m4n wants this:
Comment #8
johnvOk, Hmmm, now I think I understand your use case, too :-).
If I may throw in a suggestion/workaround:
- as a workaround, you can use the Legend/Striping. Hide the fields (which are not necessary, unless you have hours), and set a striping color.
- as a long-term solution: The theming (also in striping/legend?) can be extended. Some other issues try to set the background, this issue sets a text.
Comment #9
arlinsandbulte CreditAttribution: arlinsandbulte commented@#4 tr33m4n:
I have no idea how to do #1. Not even sure if it is possible... it was just a thought that might spark an idea in you or someone else.
Actually, I think my method 2 in comment #3 above could actually be a more robust and even better performing method.
In your original method, each project node has lots of different date fields.
In my #2 proposal, each project node has NO date fields. Each milestone sub-node as a SINGLE date field & a SINGLE node reference field.
I can think of a few ways to configure milestone sub-nodes:
1.) Sub-nodes have only title & date fields (no body, etc.) Users use the sub-node title to indicate the type of milestone event (Client Brief Meeting, Cost Estimate Provided, Further Information, etc.) This provides LOTS of flexibility for the type of dates you can add to your project, but maybe you don't want that...
or
2.) Add a taxonomy vocabulary to the sub-node to restrict the type of milestone event. Title becomes meaningless in this case (you could use Automatic Node Titles or Automatic Entity Label to hide the title).
Adding milestones to your project could be accomplished in a very similar way to Jeff Eaton's image gallery example, but using a date field instead of an image field.
The calendar view would just display the milestone sub-nodes, probably with some relationships defined to also pull in project information (like project title).
I'm not sure about how to handle your "views display on the other end of things displaying nodes kind of like a spreadsheet with editable fields..." For simple display, a view with some added relationships should work well. But, it sounds like you might be using editablefields in there too. I think that could still be made to work without much or any coding work, but I am not very familiar with editablefields.
It might also depend on your required or desired workflow needs.
Comment #10
tr33m4n CreditAttribution: tr33m4n commented@ arlinsandbulte,
Thank you for your suggestions, I will try some of these and see what the outcome is... Will get back to you and post a working solution
Cheers
Dan
Comment #11
Fred E CreditAttribution: Fred E commentedI'm just encountering this same issue. Did you find a way to work around this?
Comment #12
Neslee Canil Pinto