views:

982

answers:

2

Hi,

I've created a view with a set filters exposed (to show filtering options in the page). And one of those filters is a select field with all the taxonomy terms of a vocabulary.

That's ok, it's showing now. But I want to only show the taxonomy terms that have at least one node associated to it. To avoid empty results if selects an empty term.

Anyone knows how to do that?

Thanks.

+1  A: 

This would be a great feature for Views to have and you should submit a feature request to the maintainers for it. Unfortunately you can't do this with the existing Views code.

\What you could do, though, is see how Views constructs a filter control in its own source code, and implement that function yourself and add in an extra check to see if there are any posts with that term or not, and not display that term if there aren't any.

alxp
+2  A: 

Take a gander at the solution over at http://www.ixis.co.uk/blog/views-intelligent-taxonomy-filtering