Vocab Index -- Not rendering empty terms

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
jnicola's picture

Hello everyone,

So I'm working on this project, and it's been going pretty great thus far. I'm incredibly close to being done and really kicking ass at getting the site perfect. Then I stumble accross this big pitfall with vocabulary index: I don't want to display terms with no nodes assosciated with them.

Explenation of where the problem occurs:

Say I create a node, which has a vocabulary setup for free tagging. Let's say the node is called "Hamburger burger" and the vocabulary is "Toppings" so I input... cheese, ketchup, Peanut butter and Mustard. I then later discover peanut butter is miserable on cheeseburgers, and I delete it from the node. The term is still saved, and when I view a vocab index for for "Toppings" Peanut butter is still displayed, even if no other nodes reference it.

So, is there any way of fixing this, or should I submit it to the module... or how should I go about this? Maybe some one could explain to me what line in the code is where the topics are displayed, along with the node count. If they're all in the same spot (as I imagine) I could determined the node count firt and only display the node count if it is greater than 0.

Seriously, what's the point of display an empty term?

Comments

What's the point of having

Xano's picture

What's the point of having an empty term?

Currently, there is no way to achieve what you want without hacking the module. You'd have to filter out empty terms in vocabindex_vi_view() where node counts are calculated.

Taxonomy

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week