Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
edited title
Link
Andy
  • 169
  • 1
  • 11

Drupal Views > Filter Criteria > Exposed Filter > How to disableddisable output of options that aren't attached/used by a node

Source Link
Andy
  • 169
  • 1
  • 11

Drupal Views > Filter Criteria > Exposed Filter > How to disabled output options that aren't attached/used by a node

I have a exposed filter setup to filter content within a view.

The view is displaying a list of house designs. These designs need to be able to be filtered by number of beds, bathrooms etc.

"House Design" content type/node has a field (List (integer)) for bedrooms:

http://theexhale.com/screenshot_1.png

The allowed values for this field are 1,2,3,4,5 (bedrooms)

http://theexhale.com/screenshot_2.png

The issue I'm having is that the exposed filter is outputting all of these fields for sorting the view even though currently only values "2" and "4" are being used by the "House Design" content type.

http://theexhale.com/screenshot_5.png

QUESTION: Can the exposed filter be smart enough to check to see if values of a field/taxonomy vocab are actually being used by the displayed content type/node and then dynamically only display those values in the filter?

I want to do this to remove/lesson the possibility of no results when a user uses the filter.

Thank you :)