views:

28

answers:

1

I'm currently creating a view in Drupal that contains a number of fields. What I want to do is to create an exposed filter that is able to filter duplicate titles. The filter would be a checkbox.

This is an example of the list

NAME           TIME      RACE                  DISTANCE
John Doe       2.07.54   Boston Marathon       42km
Jane Boss      2.15.21   Boston Marathon       42km
John Doe       2.02.22   Boston Marathon       42km
Jane Boss      2.15.44   Boston Marathon       42km

What I want to have is an exposed filter that only shows one unique NAME and sorts it by its best time. The resulting list would look as follows:

NAME           TIME      RACE                  DISTANCE
Jane Boss      2.15.21   Boston Marathon       42km
John Doe       2.02.22   Boston Marathon       42km

Any help is appreciated!

A: 

I don't think you can have that as a checkbox. Instead, just create to displays, first with all records, with url for example: path/to/view/all and set its menu to "default menu tab" and name it all For the second, override the "style" property of the view and grouping field "title". For the second make its path underneath the first (like path/to/view/unique) and set its menu item to be "menu tab" and name it "unique" What will happen is that when you to path/to/view, you'll see two tabs, the default one being all, the second being "unique".

redben
I would try DISTINCT first, but basically the same approach. Uniqueness is not really made available as an Exposed Filter, and "Exposed" is the Views term you would need for something like that checkbox to work.
Grayside

related questions