-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Description
If the last submenu item is set to 'hidden' (not shown), the ul/li - stuctur is broken
Threfore I added the closing statment before continue:
if ($menu_show!=1) {
// ** ... Hack fixing the problem of a last item that is hidden
if ($item->shallower)
echo str_repeat('</ul></li>', $item->level_diff);
// ***
continue;
}
Now ist works, but ...
... if there is only one sub-item and this is hidden, the 'caret' is still shown.
To fix this 'quick and dirty' I compare in the type-functions a small hint from the menu-item-note.
if($item->deeper && $item->level < 2 && strpos($item->note, 'NODEEP') === false ){
$class .= ' dropdown-toggle';
$dropdown = ' data-toggle="dropdown"';
$caret = '<em class="caret"></em>';
}
My changes work ;) ... but only until the next update.
I propose a recursive buildup of the menu instead of the linear one in the function render($list). Then you know exactly whether an item is displayed and whether whole submenus may be empty and no dropdowns are to be displayed (not use $item->deeper, this could be hidden).
Metadata
Metadata
Assignees
Labels
No labels