When using repeat date API on a field, Drupal allows you to group events so they don't appear multiple times.
However, when sorting by date it seems like Drupal ALWAYS shows all of the entries no matter what.
How can this be avoided?
I just ran into this issue myself. The solution is to add a filter of the date delta field =0. This means only show the 0th (first) matching item and hide any repeating values.
Hope this helps someone. Selwyn
the delta option only works when you display fields, but if your displaying a display content node it wont work. I'm using display suite to manage the output of the display so the delta field wont work. What i did was create a views specific template file:
I basically detect if there is a duplicate and just make a conditional to bypass the output of it.
The live page is here: http://www.xcubicle.com/events
1 <?php 2 3 /** 4 * @file 5 * Default simple view template to display a list of rows. 6 * 7 * - $title : The title of this group of rows. May be empty. 8 * - $options['type'] will either be ul or ol. 9 * @ingroup views_templates 10 */ 11 12 13 14 15 $rows = array_unique($rows); 16 17 ?> 18 <?php print $wrapper_prefix; ?> 19 <?php if (!empty($title)) : ?> 20 <h3><?php print $title; ?></h3> 21 <?php endif; ?> 22 <?php print $list_type_prefix; ?> 23 <?php foreach ($rows as $id => $row): ?> 24 <li class="<?php print $classes_array[$id]; ?>"><?php print $row; ?></li> 25 <?php endforeach; ?> 26 <?php print $list_type_suffix; ?> 27 <?php print $wrapper_suffix; ?>
This worked for me in the Views field configuration for the Date field:
When in the views edit screen, make sure that you are displaying fields, and configure the date field in question to 'Hide Repeat Rule' and under 'Multiple Values' set it to show 1 value.
this can also be achieved by going to views Advanced settings, under OTHER settings you will find Query settings just open it and check the "Distinct" option. Only single value will be shown.
I have been playing around with these settings and have stumbled upon an answer:
I also removed the Filter Criteria for Date Delta, which I was trying (unsuccessfully) to use for creating distinct records.