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.
Comments
Comment #1
creatorsdream commentedThis 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?
Comment #2
brmassa commentedGuys,
im a new maintainer and i just launched the new version of the module. it now has this feature.
regards,
massa
Comment #3
hutch commentedI 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.
Comment #4
kdebaas commentedHi, 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.
Comment #5
Anonymous (not verified) commented