When I use menu_position with menu_block and follow active, I encounter situations when the menu_block will disappear because it has followed the active trail down to the menu link generated by menu_position, which is invisible, and has no siblings.

The attached patch adds an option, that when following active, to only follow down to the point at which there are still visible siblings.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

gmclelland’s picture

gmclelland’s picture

Thank you. Your patch is working for me with the latest 2.x-dev

gmclelland’s picture

Correct me if I'm wrong, but I think the one line patch from #1620298: Add new starting level option "Children of active menu item, and active menu item if no children" might be the better solution.

quartsize’s picture

If the patch in #1620298 works as described, it won't fit quite what I need it to do, which is having the usual starting level be the active menu item and its siblings, not its children. See e.g. https://swem.wm.edu/databases. But I'll check it out more tomorrow. Thanks!

gmclelland’s picture

I believe your patch actually works a little different then the others I've tested. If I remember correctly your patch is more like a "Starting level will be: Active menu, and active menu item if no children."

The patch in #1620298: Add new starting level option "Children of active menu item, and active menu item if no children" and #1650684: [Pull request] Show siblings at deepest level is more like "Starting level will be: Children of active menu item, and active menu item if no children"

Hope that clarifies things. I was just trying to make sense of all these similar issues and consolidate them a bit to help the maintainers.

quartsize’s picture

I've now checked, and with the child_active setting, the menu_block on https://swem.wm.edu/databases contains just the children (new, trials, ...), not the page's siblings Ask Us, Search the Catalog, &c. with its children expanded, as desired. Moreover, the impetus for my patch, missing menus for the menu_positioned children of https://swem.wm.edu/forms, is not satisfied: neither it nor its children end up with menus.

Hope that clarifies things. I was just trying to make sense of all these similar issues and consolidate them a bit to help the maintainers.

Thank you; I'm hoping what I've written here also makes things a bit clearer.

quartsize’s picture

Re-rolled for 7.x-2.5, in particular d9760209.

jwilson3’s picture

Status: Needs review » Closed (duplicate)
Related issues: +#758184: Show items on same level if active menu level doesn't have children

I have a patch ready for Drupal 8, but I'm trying to decide where to put it.

I would propose the following three issues be closed as a duplicates because #758184: Show items on same level if active menu level doesn't have children predates all of them and has more followers than any of these others combined. I will put my D8 patch there.

* #1125154: "Deepest item in the active trail with visible siblings" as option for follow_parent (this issue)
* #1620298: Add new starting level option "Children of active menu item, and active menu item if no children"
* #1650684: [Pull request] Show siblings at deepest level