Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
menu_block-follow-active_visible.patch | 2.06 KB | quartsize | |
#7 | activevisible-1125154-7.patch | 2.06 KB | quartsize |
Comments
Comment #1
gmclelland CreditAttribution: gmclelland commentedSimilar issue at #1650684: [Pull request] Show siblings at deepest level
Comment #2
gmclelland CreditAttribution: gmclelland commentedThank you. Your patch is working for me with the latest 2.x-dev
Comment #3
gmclelland CreditAttribution: gmclelland commentedCorrect 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.
Comment #4
quartsize CreditAttribution: quartsize commentedIf 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!
Comment #5
gmclelland CreditAttribution: gmclelland commentedI 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.
Comment #6
quartsize CreditAttribution: quartsize commentedI'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 themenu_position
ed children of https://swem.wm.edu/forms, is not satisfied: neither it nor its children end up with menus.Thank you; I'm hoping what I've written here also makes things a bit clearer.
Comment #7
quartsize CreditAttribution: quartsize commentedRe-rolled for 7.x-2.5, in particular d9760209.
Comment #8
jwilson3I 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