I have a CCK event node with a date field that allows multiple values.
My view creates node teasers of events that haven't yet expired.
The issue I'd like to resolve is for events that happen multiple times, I'd like them only to appear once in the view.
I thought filtering via Node: Distinct would do that, but it doesn't appear to do so. I tried the filter at the bottom and the top of the filter list - same result.
Here's the exported view:
$view = new stdClass();
$view->name = 'upcoming_events_fix';
$view->description = 'Calendar view of any date field';
$view->access = array (
0 => '6',
);
$view->view_args_php = '';
$view->page = TRUE;
$view->page_title = 'Fix Me';
$view->page_header = '<div id="event_instructions"><p>You can use the filters to help narrow the list of events shown.<br /><br />Main Event Types are: <strong>Performing Arts -- Sports -- Film -- Visual Arts -- Craft and Fibre Arts -- Literature -- Cultural Exhibits -- Lectures/Presentations -- Social Events -- Fitness & Health -- Outdoor -- Leisure & Games -- Other</strong><br /><br />Simply select the type of event you are looking for and/or the type of audience the event caters to, and/or a maximum price for admission.<br /><br /><em>For detailed instructions, please see the <a href="/help">Help + User Guide</a>.</em></p></div>';
$view->page_header_format = '3';
$view->page_footer = '';
$view->page_footer_format = '1';
$view->page_empty = '';
$view->page_empty_format = '1';
$view->page_type = 'teaser';
$view->url = 'events/upcoming/fix';
$view->use_pager = FALSE;
$view->nodes_per_page = '0';
$view->menu = TRUE;
$view->menu_title = 'fix';
$view->menu_tab = FALSE;
$view->menu_tab_weight = '10';
$view->menu_tab_default = FALSE;
$view->menu_tab_default_parent = NULL;
$view->menu_tab_default_parent_type = 'tab';
$view->menu_parent_tab_weight = '0';
$view->menu_parent_title = '';
$view->sort = array (
array (
'tablename' => 'node_data_field_date_time',
'field' => 'field_date_time_value',
'sortorder' => 'ASC',
'options' => '',
),
);
$view->argument = array (
);
$view->field = array (
);
$view->filter = array (
array (
'tablename' => 'node',
'field' => 'status',
'operator' => '=',
'options' => '',
'value' => '1',
),
array (
'tablename' => 'node',
'field' => 'type',
'operator' => 'OR',
'options' => '',
'value' => array (
0 => 'event',
),
),
array (
'tablename' => 'term_node_3',
'field' => 'tid',
'operator' => 'OR',
'options' => '5',
'value' => array (
0 => '101',
),
),
array (
'tablename' => 'term_node_4',
'field' => 'tid',
'operator' => 'OR',
'options' => '',
'value' => array (
),
),
array (
'tablename' => 'node_data_field_admission',
'field' => 'field_admission_value_default',
'operator' => '<=',
'options' => '',
'value' => '',
),
array (
'tablename' => 'node_data_field_date_time',
'field' => 'field_date_time_value_to|default',
'operator' => '>',
'options' => '',
'value' => 'now',
),
array (
'tablename' => 'node',
'field' => 'distinct',
'operator' => '=',
'options' => '',
'value' => array (
0 => 'distinct',
),
),
);
$view->exposed_filter = array (
array (
'tablename' => 'term_node_3',
'field' => 'tid',
'label' => 'Type of Event',
'optional' => '1',
'is_default' => '0',
'operator' => '1',
'single' => '1',
),
array (
'tablename' => 'term_node_4',
'field' => 'tid',
'label' => 'Audience',
'optional' => '1',
'is_default' => '0',
'operator' => '1',
'single' => '1',
),
array (
'tablename' => 'node_data_field_admission',
'field' => 'field_admission_value_default',
'label' => 'Max. Price',
'optional' => '1',
'is_default' => '0',
'operator' => '1',
'single' => '0',
),
);
$view->requires = array(node_data_field_date_time, node, term_node_3, term_node_4, node_data_field_admission);
$views[$view->name] = $view;
Of course, this could be a CCK issue.
Also, date RANGES work fine - it's one entry into the array; multiple dates create an array of data.
The pic shows an event that happens at two distinct times during the day - I wish it would display only once (as it is only one node)
| Comment | File | Size | Author |
|---|---|---|---|
| views_node_distict.jpg | 79.5 KB | shawnpetriw |
Comments
Comment #1
shawnpetriw commentedIf you want to see the actual webpage:
http://thepulse.ca/events/upcoming
Comment #2
shawnpetriw commentedWhile I would like to see this looked at, I have gone another route. From another issue post:
I believe this is somehow due to using multiple dates in the CCK field.
When nodes are displayed by this view, if the node has multiple dates, it is displayed multiple times. (Node: Distinct in the view does not seem to constrain this).
So, for example, 10 events may display 15 instances because one event has a run of 6 dates.
I'll bet the pager, when invoked, seeing there are only 10 NODES is looking to display only 10 INSTANCES, and thinks it's done after 10 and doesn't show the other 5 instances event though NOT ALL the NODES have been displayed.
My solution for my roll-it-yourself events will be to remove multiple dates functionality and use the node clone module to deal with repeating events.
(Yes, I know about event module and event repeat - I chose to roll my own for a number of good reasons at the time, which may or may not still hold true).
Comment #3
sunYour latest comment sounds like you were able to fix this issue.
Comment #4
cpelham commentedHe didn't fix the issue. He gave up and tried something else. I have the same issue except when I try to turn on distinct:yes I get an error so I can't even try that. The distinct:yes error may be a bug, but the desire to have the option for a view to list only one instance of an event with a repeating date may be a feature request rather. Can someone say if this is what distinct:yes is supposed to do?
Comment #5
yched commentedcpelhan : don't bump 5.x issues to 6.x. Views 2 for D6 has almost nothing in common with Views 1 for D5, so any issue / request that might seem related most probably deserve a separate issue.
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.