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.
In the config for a menu block there is an option to set the menu to be expanded but I'd like have my menu auto-expanded only to a certain depth rather than all the way down so $config['expanded'] would contain a number indicating this depth rather than a do it or not flag.
Do you think it would be simple to implement and would you be able to give any guidance - I was guessing I'd need to write a module to hook into your module rather hacking about with your code in the same way that one does with core though I'm a bit new to module writing.
Ta
Chris
Comment | File | Size | Author |
---|---|---|---|
#1 | maximum-depth-menu-block.png | 19.45 KB | JohnAlbin |
Comments
Comment #1
JohnAlbinAll of menu block's options are designed to work together. Have you tried the "Maximum depth" option in combination with the "expanded" option?
Comment #2
chunty CreditAttribution: chunty commentedWhat I'm after is a way the starting auto-expanded level and then I can expand further as I browse - I believe this is the maximum depth the tree is allowed to expand...?
Comment #3
JohnAlbinIf you want that behavior, you can configure each menu link in your menu so that they are always expended. That's not a menu_block configuration, that's a feature in Drupal core.