Nice Menus module generate empty submenu, when submenu has invisible items (e.g. for "views" or "Image styles" items).


It is simple to fix this problem. Add to nicemenus.module, line 569, theme_nice_menus_build function:
// ................
if ($trail && in_array($mlid, $trail)) {
$class .= ' active-trail';
}
// ------------ added
if ($has_below = !empty($menu_item['below'])) {
foreach ($menu_item['below'] as $below_item) {
$has_below = $below_item['link']['hidden'] == 0;
if ($has_below) {
break;
}
}
}
// ------------ added
// If it has children build a nice little tree under it.
// Build a nice little tree under it if it has children, and has been set
// to expand (when that option is being respected).
if ((!empty($menu_item['link']['has_children'])) &&
($has_below) && $depth != 0 && // <-- changed from: (!empty($menu_item['below'])) && $depth != 0 &&
($respect_expanded == 0 || $menu_item['link']['expanded'])) {
// ......
Comments
Comment #1
formatix labs commentedComment #2
formatix labs commentedComment #3
avpadernoComment #4
astonvictor commentedD7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.