Jump to:
| Project: | Calendar |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (fixed) |
Issue Summary
I am trying to display multiple content types' dates in a calendar view (Yes, I have posted there, too - don't know who's issue [ besides mine :p]) and each content type has their own cck date field, for various reasons. (Event - can have "to and from"; Case tracker can have "due date" etc.)
I wanted all these dates to show up on the same calendar. I have the content types specified, and arguments and fields are all correct - I can set them up individually to display only one content type, and it displays. When I try and double-down to show more than 1 content type, they all disappear. The filters are the same (except Node: Type can include more or less options).
I've narrowed down the issue to when I try and add a fields for both content types. Since the Dates are different CCK fields, I have them all listed. If I only show the CCK field for 1 content type, then it shows up in the calendar. If I try listing both CCK date fields in the fields list, none of them show up. Shouldn't they all show up?
Here's the exported view:
$view = new view;
$view->name = 'atrium_calendar';
$view->description = 'Atrium > Calendar';
$view->tag = 'atrium';
$view->view_php = '';
$view->base_table = 'node';
$view->is_cacheable = FALSE;
$view->api_version = 2;
$view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
$handler = $view->new_display('default', 'Defaults', 'default');
$handler->override_option('fields', array(
'title' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'exclude' => 0,
'id' => 'title',
'table' => 'node',
'field' => 'title',
'relationship' => 'none',
),
'field_duedate_value' => array(
'label' => 'Due date',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'widget',
'format' => 'long',
'multiple' => array(
'multiple_number' => '',
'multiple_from' => '',
'multiple_to' => '',
'group' => TRUE,
),
'repeat' => array(
'show_repeat_rule' => '',
),
'fromto' => array(
'fromto' => 'both',
),
'exclude' => 1,
'id' => 'field_duedate_value',
'table' => 'node_data_field_duedate',
'field' => 'field_duedate_value',
'relationship' => 'none',
),
'field_date_value' => array(
'label' => '',
'alter' => array(
'alter_text' => 0,
'text' => '',
'make_link' => 0,
'path' => '',
'link_class' => '',
'alt' => '',
'prefix' => '',
'suffix' => '',
'help' => '',
'trim' => 0,
'max_length' => '',
'word_boundary' => 1,
'ellipsis' => 1,
'strip_tags' => 0,
'html' => 0,
),
'link_to_node' => 0,
'label_type' => 'none',
'format' => 'default',
'multiple' => array(
'multiple_number' => '',
'multiple_from' => '',
'multiple_to' => '',
'group' => TRUE,
),
'repeat' => array(
'show_repeat_rule' => '',
),
'fromto' => array(
'fromto' => 'value',
),
'exclude' => 1,
'id' => 'field_date_value',
'table' => 'node_data_field_date',
'field' => 'field_date_value',
'relationship' => 'none',
),
));
$handler->override_option('arguments', array(
'date_argument' => array(
'default_action' => 'default',
'style_plugin' => 'default_summary',
'style_options' => array(),
'wildcard' => 'all',
'wildcard_substitution' => 'All',
'title' => '',
'breadcrumb' => '',
'default_argument_type' => 'date',
'default_argument' => '',
'validate_type' => 'none',
'validate_fail' => 'not found',
'date_fields' => array(
'node_data_field_date.field_date_value' => 'node_data_field_date.field_date_value',
'node_data_field_date.field_date_value2' => 'node_data_field_date.field_date_value2',
'node_data_field_duedate.field_duedate_value' => 'node_data_field_duedate.field_duedate_value',
),
'year_range' => '-3:+3',
'date_method' => 'OR',
'granularity' => 'month',
'id' => 'date_argument',
'table' => 'node',
'field' => 'date_argument',
'validate_user_argument_type' => 'uid',
'validate_user_roles' => array(
'2' => 0,
'3' => 0,
'5' => 0,
'6' => 0,
'4' => 0,
),
'relationship' => 'none',
'default_options_div_prefix' => '',
'default_argument_user' => 0,
'default_argument_fixed' => '',
'default_argument_php' => '',
'validate_argument_node_type' => array(
'casetracker_basic_project' => 0,
'casetracker_basic_case' => 0,
'shoutbox' => 0,
'blog' => 0,
'book' => 0,
'event' => 0,
'feed_ical' => 0,
'feed_ical_item' => 0,
'group' => 0,
'profile' => 0,
'pingv_gallery' => 0,
'pingv_image' => 0,
'feed' => 0,
),
'validate_argument_node_access' => 0,
'validate_argument_nid_type' => 'nid',
'validate_argument_vocabulary' => array(
'1' => 0,
),
'validate_argument_type' => 'tid',
'validate_argument_transform' => 0,
'validate_user_restrict_roles' => 0,
'validate_argument_is_member' => 0,
'validate_argument_php' => '',
),
));
$handler->override_option('filters', array(
'type' => array(
'operator' => 'in',
'value' => array(
'casetracker_basic_case' => 'casetracker_basic_case',
'event' => 'event',
'feed_ical_item' => 'feed_ical_item',
),
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'type',
'table' => 'node',
'field' => 'type',
'relationship' => 'none',
),
'status' => array(
'operator' => '=',
'value' => '1',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'status',
'table' => 'node',
'field' => 'status',
'relationship' => 'none',
),
'current' => array(
'operator' => 'active',
'value' => '',
'group' => '0',
'exposed' => FALSE,
'expose' => array(
'operator' => FALSE,
'label' => '',
),
'id' => 'current',
'table' => 'spaces',
'field' => 'current',
'relationship' => 'none',
),
));
$handler->override_option('access', array(
'type' => 'spaces_feature',
'spaces_feature' => 'atrium_calendar',
));
$handler->override_option('cache', array(
'type' => 'none',
));
$handler->override_option('title', 'Calendar');
$handler->override_option('items_per_page', 0);
$handler->override_option('style_plugin', 'litecal');
$handler->override_option('style_options', array(
'grouping' => '',
'style' => 'full',
'quickadd' => 'event:field_date',
));
$handler = $view->new_display('page', 'Page', 'page_1');
$handler->override_option('path', 'calendar/view');
$handler->override_option('menu', array(
'type' => 'default tab',
'title' => 'Calendar',
'description' => '',
'weight' => '-20',
'name' => 'navigation',
));
$handler->override_option('tab_options', array(
'type' => 'normal',
'title' => 'Calendar',
'description' => '',
'weight' => '0',
));
$handler = $view->new_display('block', 'Block', 'block_1');
$handler->override_option('style_options', array(
'grouping' => '',
'style' => 'compact',
'quickadd' => 'event:field_date',
));
$handler->override_option('block_description', '');
$handler->override_option('block_caching', -1);
$translatables['atrium_calendar'] = array(
t('Defaults'),
t('Calendar'),
t('Page'),
t('Block'),
);
Comments
#1
The issue is that they really need to be the same field. With SQL queries, it's very difficult to share different fields across something like a calendar. You can add the same field to multiple content types, though. Unfortunately, this is kind of a difficult change to make midstream, but it is what you have to do if you want this to work.
#2
I don't know how calendar works internal but i guess, it groups the result by the selected date field. Then views cannot do anything here.
Move to Calendar issue queue.
I think someone else should have asked the same question, i cannot imagine that you are the first person who wants to know this :)
#3
Thanks guys! I'll be following up more over there, then.
Theoretically, though, if it wasn't calendar it *would* display all values, right?
[edit]
that was confusing - Didn't realize you moved it here for me. :)
#4
After some searching in Calendar issues (since I wasn't sure what and where I should look for before) I came across this: http://drupal.org/node/426788
I think it may be the same issue as that, except the solution provided there does not work. The difference between what they were trying to do and what I was trying to do is that I have actual multiple CCK field types, rather than a single CCK filed with multiple values. And, nothing shows up (not even the first result, like in the above link)
#5
Bump. Help?
#6
The silence is not very reassuring.
To recap the question with extreme brevity:
I am unable to have a calendar display two different cck date fields. One cck date field type at a time displays fine. 2 types makes them all disappear.
help?
#7
why is nobody saying anything??
#8
@tevih
I have multiple content types and I display them all on one calendar by color coding them(color coding isnt the key...this was poorly worded) . Have a look at
http://pack329.net/calendar
Is this what you want?
I have several content types:
Den1 Event
Den3 Event
Leadership
etc etc
I got started w/ Simpleviews module and had it build views for me for one content type. I then used that view to tweak the default calendar view to make it work for me.
Rather than export the view, which means nothing to me BTW, I'll list what I've got.
Relationships = NULL
Arguments = Date:Date (node) Content: Date (field name) - From Date OR Content:Date(field name) -From Date (i did this for each content type)
Node: Type
Fields Node: Type, Node: Title, Content: Date - From Date (Content:Date for each content type)
Filters = Node: Published Yes, Node: Type EACH EVENT
You'll have to tweak to your needs but maybe that will get you on the right track.
If exporting will help you I'll be glad to but I get lost in that code.
#9
Thanks! That might be what I'm looking for. I have one question, though - "Content: Date" in your fields, is that the same field for both content types? Or did you create two different date field types, one for each content type?
Exporting the view does not mean much for me, either, but it was one of the guidelines for submitting an issue...
#10
I have a date field for each content type. However the date field is configured only on content types that have dates/events or are associated w/ the views/calendar modue(s).
Do you have your field setup as a DateTime type?
Also, this video helped me along as well as leveraging SimpleViews to help fill in the blanks some.
Something I repeatedly failed to do was override the defaults when configuring another block, just something to watch out for.
I hope that helps.
#11
This would be great to have.
#12
@tevih #8
Can you post an "export of your view"?
#13
Thanks Merlin, this solved my problem, I set my two CCK content types to pull from the same field
#14
@merlinofchaos -- the problem with your solution is that if you pick the same date field for different content types, then the settings for that date field will affect all contnet types that it is associeted with. But what if some content types have Dates To (end-time) while others only have a single date field? what is some have granularity of minutes, while others have granularity of Day? what if some content types have date-repeat, while others don't?
How then can we present all these different content types with either varying date fields or the same date field, but with varying configurations -- all in the same calendar view?
Simple Example: I have 2 content types - Jobs and Events. Jobs have a Deadline date field (a single datefield with day granularity). Events can have From and To dates with hours granularity. How then can we make a Calendar View that will display both content types? Is this possible in Views 3? (I have been trying to construct a Calendar like this since 2007 with Events that I have RSVPed and deadlines that I have flagged - but it still seems like it's impossible in Drupal)
We must recognize that different content types will have different date requirements and configurations :(
#15
Signed...
14 is right!
Put different datefields from different contents in one calendar is a must. Lets try awreneau technique...
#16
#8 - unfortunately, it is not explaining enough to me :(
But, it´s one year old post. No one have any workaround now, how to achieve to show dates from more contents in one calendar???
#17
BTW, if you haven't seen it yet, be sure to check out: http://drupal.org/project/fullcalendar There's some very active development going on with this right now (http://drupal.org/node/906112). I haven't tested it but it looks like you can list all of the CCK fields you want to support. They're also actively working on drag-n-drop rescheduling and handling multiple datetime values per node.
#18
Ok, I just tried setting up multiple fields using fullcalendar and it works great! Three different node types with three different CCK date fields all appearing on one beautiful calendar. No relationships to setup. No arguments to setup. Just list the fields by name in a simple list in the configuration, and there they all are.
I'm sure there's lots of stuff fullcalendar can't do yet, but it does seem to support multiple fields quite nicely. Check it out: http://drupal.org/project/fullcalendar
#19
FullCalendar looks very promising, but then it lacks possibility to have different titles per content type and many other settings.
#20
FullCalendar does support different css classes for each content type so color coding according to content type is easy. I'm curious. Why do you want different titles? I can think of a number of work-arounds for doing that with FullCalendar if you actually need it.
#21
Well my case is that I have one content type called "Reservation". These should appear in the calendar with a title "Reserved" and red background. Then I want to merge event to this "Reservation Calendar", and there I would like to show the title of the event.
I could name every reservation "Reserved" but it doesn't sound right. Another thing what I like about the fields based approach of calendar-module is that I only need to add the fields in Views and decide how they are formatted. Maybe there could be node based and fields based solution in FullCalendar?
#22
Confirmed, as KarenS says in #426788-31: Month view in Calendar won't display multiple cck date values, that this is fixed in dev.
Try updating to Calendar 6.x-2.x-dev and Date 6.x-2.x-dev
#23
Hi, I updated the Calendar & Date, added two node displays as filters to my calendar view:
Weekly Happenings
Happy Hour
These are both two separate content types with repeating dates, I am going to add a third one that is "Special Events", but I can't get the two that I have to display, just "Weekly Happenings" which is the first one I created. Is there something specific that I need to do that I am missing?
Any help would be appreciated, i am building my first full on drupal website :)
#24
Automatically closed -- issue fixed for 2 weeks with no activity.