A menu item's unchecked "expanded" option should, in theory, prevent the submenu for that menu item from rendering. However, when viewing a page that is a parent menu item (active-trail) to a submenu set up with menu_position, the submenu gets rendered regardless of whether the parent menu item is set as expanded or not.

Say we're on the page listed as MENU ITEM 1 below, this is how menu_position currently works:

MENU ITEM 1 ("expanded" unchecked)
-- SUBMENU (renders regardless of parent's "expanded" option)
MENU ITEM 2
MENU ITEM 2

Possible fixes:
- Do not render the submenu for the specific parent menu in theme_menu_link() (yuck)
- Hide submenu w/ CSS (double yuck)

I had though that commenting out this line in menu_position.module might fix things, but alas, it does not:
menu_position_expand_parent_link($rule->plid);

Thanks for any input in advance!

Comments

jimmynash’s picture

I ran into this today as well. It seems like this expansion is core behavior.

We were originally setting disabled menu items into a menu to keep the active trail set but that became too cumbersome.
Using the block created by the custom menu would always show the expansion even if the parent item was set to not be expanded. That was why we were disabling the sub menu items.

I came upon this module to use the rules instead of manually creating the menu items. My current workaround is to use a Menu Block menu instead of the core block setting its depth to 1 only.

I'm not sure that Menu Position can fix this or not as I think it is core behavior.

jimmynash’s picture

Issue summary: View changes

fix typo in theme_menu_link