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.
I needed to show the number of rows in the view with each specific value next to that value in the filters.
This patch adds an option to the selective filter handler to enable this item count. When this is enabled a modified version of _views_filter_selective_query
is used to count the rows in the view with that value in the field and this number is appended to the option in the filter widget (see screenshots below).
Comment | File | Size | Author |
---|---|---|---|
#1 | views_hacks-item_count_in_filter_values_for_selective_filter-2034197-1.patch | 4.12 KB | mpv |
#1 | views_hacks-item_count_in_filter_values_for_selective_filter-7.x-1.0-alpha2-2034197-1.patch | 5.44 KB | mpv |
filter.png | 5.73 KB | mpv | |
view.png | 39.35 KB | mpv |
Comments
Comment #1
mpv CreditAttribution: mpv commentedHere is the patch. First patch applies to latest HEAD and second patch applies to 7.x-1.0-alpha2.
Comment #2
mpv CreditAttribution: mpv commentedComment #3
infojunkieThis module has been deprecated in favour of https://drupal.org/project/views_selective_filters. Please test there and reopen if necessary.