Hide Menu Branches When Category Is Empty
Xangis - March 24, 2007 - 07:20
| Project: | Taxonomy Menu |
| Version: | 5.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (reviewed & tested by the community) |
Description
I would like to have a setting that automatically hides a category in the taxonomy menu when it is empty.
For instance, if there is a site that has three terms, cats, dogs, and weasels and the site has two pages categorized "cats" and one "dogs" but none categorized "weasels", I would like a setting that lets me automatically hide the "weasels" menu if it is empty.
Although individual menus can be disabled, I have a site where item categories are constantly changing and some items are recategorized. Instead of having to manually maintain all of the menus by enabling and disabling them by hand, it would be nice to have this be an automatic process.

#1
This would be a great feature! I've recently set up a new site and I'm having to manually hide menu items so visitors don't get frustrated realizing there is no content in the menu items.
There isn't any other modules which implement the concept of hiding empty taxonomy terms automatically from listing as menus, is there?
#2
Guys,
im a new maintainer and i just launched the new version of the module. it now has this feature.
regards,
massa
#3
I found the hide-when term-is-empty function was not working quite right, fortunately it's an easy fix, patch attached.
The variable $num needs to be defined before the 'taxonomy_menu_hide_empty' variable is fetched, so the patch just moves it up 4 lines.
#4
Hi, I noticed that the hide-when-term-is-empty wasn't working quite right (it hid all terms in my secondary links). Then I came across this patch, and applied it. Now, it functions as expected. Thanks.