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.
From time to time I'd like to create a display of a menu, usually for administrative purposes, that shows all menu items—even those that have been disabled. It would be most helpful to have a checkbox in a Menu Block's configuration to "Show disabled menu items".
Comment | File | Size | Author |
---|---|---|---|
#16 | Screenshot-1005440-3.png | 496.15 KB | Nikhil_110 |
#16 | Screenshot-1005440-2.png | 658.94 KB | Nikhil_110 |
#16 | Screenshot-1005440-1.png | 284.9 KB | Nikhil_110 |
#15 | menu_block-show_hidden_items-1005440-15.patch | 2.98 KB | jacobbell84 |
| |||
#14 | menu_block-show_hidden_items-1005440-14.patch | 2.97 KB | dshields |
|
Comments
Comment #1
BenPoole CreditAttribution: BenPoole commented+1 This would be very helpful in a sitemap or an admin area. In my case, just because I don't want a menu item displayed in the site's main navigation doesn't mean I don't want it in ANY menu or display.
Comment #2
pcavanaugh CreditAttribution: pcavanaugh commentedI needed this functionality so I created a patch (against 7.x-3.x). Attaching the patch to request inclusion in the next stable release…
Comment #3
TravisCarden CreditAttribution: TravisCarden commentedNicely done, @pcavanaugh; it works great. Way to hit the ground running on Drupal.org! :)
Comment #4
brad.bulger CreditAttribution: brad.bulger commentedI tried adapting this patch for the 2.x branch, since that's what we're using. I had to go into the Advanced settings to toggle "Expand all children of this tree." to get everything to show up, after that it worked fine. Maybe this new setting should also be in the Advanced set?
Comment #5
brad.bulger CreditAttribution: brad.bulger commenteda reroll of the 2.x patch against current state of that branch, for anybody else who might still be back on this.
Comment #6
Dave ReidThis code needs to assume existing/exported menu block configurations do not have this value set and not using !empty() will cause a PHP notice here.
Comment #7
brad.bulger CreditAttribution: brad.bulger commentedreroll of patch against current 2.x, plus added
empty()
calls to address issue in comment 6Comment #8
visabhishek CreditAttribution: visabhishek as a volunteer and at Azri Solutions commentedChanging status to Needs Review
Comment #9
dshields CreditAttribution: dshields commentedThis doesn't seem to work for menu blocks that are created as panel panes.
Comment #10
PolThanks, patch working flawlessly. Can't wait to see this in.
Comment #11
PolFYI, the patch has been applied to 7.x-2.7 but the issue if for 7.x-3.x, I guess the patch is also ok for 7.x-2.x then.
Comment #12
joelpittetPutting back to needs work for #9 . @dshields can you provide more detail?
Comment #13
drumm(Disregard - saving to fix some database inconsistency following an outage.)
Comment #14
dshields CreditAttribution: dshields commentedHere's a patch for Drupal 8.
Comment #15
jacobbell84 CreditAttribution: jacobbell84 at ZenSource commentedDoing a quick re-roll for 1.10 and fixing an unused variable.
Comment #16
Nikhil_110 CreditAttribution: Nikhil_110 at Srijan | A Material+ Company commentedThe above patch is applied successfully for Menu Block v8.x-1.x-dev.
Attaching the screenshot for reference.
Test Setps