0

Background: a) Taxonomy: I have built as site that allows users to tag content of a particular content type with tags. The system started with a pre-existing taxonomy before any content was added, but has grown organically as users add content and terms of their own. What this means, of course, is that at any time, some of the terms in the taxonomy, may not be attached to any currently published content.

b) View with Exposed Tag Filter: As a means to allow users to find material of interest, I have exposed the Tag Field as a filter for a tabular view of the content. The Filter is a drop down list. When a user selects a tag from the list, the view is appropriately filtered to the matching items.

Problem: As the taxonomy has grown, a good proportion are not, at any time, attached to any content. Thus, it is frustrating for the user to filter the table with a tag list that includes these terms, as they yield 0 results.

Requested Help: Therefore, I am looking for a way, that the terms shown in the tag filter are dynamically limited to only those that are attached to currently published content. It is not clear to me how to do it. I would greatly appreciate any advice on how this may be accomplished.

2 Answers 2

0

You should have a look at Views Selective Exposed Filters, part of the Views Hacks module. It will limit the taxonomy terms to those in your view's result set.

1
  • Thanks. The module certainly intends to address the issue that I'm trying to solve. However, the "Limit list to result set" checkbox doesn't get added to the filter options after the module has been installed. Perhaps this is a known bug in the alpha software? Any insights into known bugs and workarounds for the module? I don't think I'm doing anything unusual with the filters or taxonomy in the view I've constructed. Commented Apr 3, 2013 at 1:30
0

The best answer would be: Search API Views.

List of nodes using faceted taxonomy term filters. By default faceted taxonomy filter will show only for terms 'in use'.

Still, if you really need to show a filter to terms only in published nodes, I believe this is gonna be achieved by code using some hook to alter the facets, or, automatically, if the current user does not have permission to view unpublished nodes the facet filter won't show the term.

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.