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.
use case:
my main menu is dropdown which requires all items to be set to expanded
I want to re-use part of this menu in a menu block, but in the block, I only want the active trail expanded.
The attached patch updates menu_block.admin.inc to add a "collapse all items" checkbox to the block settings and updates menu_block.module to check whether the user has checked "collapse all items" and respond accordingly (by ignoring the "expanded" setting of the menu items themselves).
Comment | File | Size | Author |
---|---|---|---|
menu_block-7.x-2.2-forcecollapse.patch | 4.92 KB | jakchapman@groups.drupal.org | |
Comments
Comment #1
JurriaanRoelofs CreditAttribution: JurriaanRoelofs commentedThanks for your work, I need this too. Unforunately this patch doesn't work for me on 2.4 and doesn't apply on newer versions