0

I have a view with an exposed filter that searches nodes for taxonomy terms. For example there are 10 terms but the nodes only use 7 of them. When the view is shown on a page the 10 terms show in the filter. 3 of the terms in the filter will yield zero results. I want to hide those terms (because they have zero results) and not make them available in the filter.

1 Answer 1

1

You can simply use Views Selective Filters Module for that.

Here is an introduction about this module :

This module allows to have an exposed filter only show options that belong to result set.

The options are calculated real-time with the current View's configuration, including the filters selected by the user so you get dynamic dependent filters, that is, when the value of one filter is changed, the list of options of the selective filters are updated accordingly to the trimmed down result set.

4
  • I have installed the module, Thanks. However, I am having a hard time trying to understand it. I can't see any changes to the view.
    – Me Lee
    Aug 9, 2018 at 16:29
  • I'm pretty sure that module adds new "selective" filters that you have to replace the default ones with in your view. Aug 9, 2018 at 23:52
  • ok, I have addes the equivalent "selective" field but it gives me no options in the display field. I guess this solution is not going to work for me.
    – Me Lee
    Aug 10, 2018 at 14:33
  • Got it working after all
    – Me Lee
    Aug 16, 2018 at 14:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.