It can be very difficult to administer menus with many items, like the admin menu. Having a nicely organized admin menu can be a huge quality-of-life improvement for developers and clients.
Several things could be done to make this experience better (being able to expand/collapse entire submenus), but one that seems relatively simple would be to add a button to toggle the visibility of menu items that are disabled. Being able to hide them would make it far easier to rearrange menu items that ARE enabled via drag and drop.
I've been doing this in the browser console by using `$('.menu-disabled').toggle()`. I figure if it helps me, then it would probably help others. Here's a very simple mockup:

| Comment | File | Size | Author |
|---|---|---|---|
| #15 | 3275513-nr-bot.txt | 2.94 KB | needs-review-queue-bot |
| #11 | Screenshot 2023-02-20 at 10.51.41 AM.png | 698.46 KB | enaznin |
| #10 | Screenshot 2023-02-20 at 10.46.19 AM.png | 766.7 KB | enaznin |
| #2 | Screen Shot 2022-04-15 at 1.22.40 PM.png | 293.54 KB | bhogue |
Issue fork drupal-3275513
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3275513-add-toggle-to
compare
- feature_hide_dis_menus
changes, plain diff MR !3497
Comments
Comment #2
bhogue commentedComment #6
enaznin commentedComment #8
enaznin commentedCurrent Implementation:


Default behavior:
After clicking:
Few notes:
1. I think the placement of the ‘hide disabled’ button should be Inside the table under the ‘Enabled’ heading. That’s how I implemented it.
2. There’s a corner case, If a parent menu is disabled while its children are enabled, only the parent menu gets hidden. As a result, the visible children seem like they are listed under the wrong parent.
Comment #9
enaznin commentedComment #10
enaznin commentedComment #11
enaznin commentedComment #12
enaznin commentedComment #13
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #14
enaznin commentedRestoring status unrelated, failure.
Comment #15
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #16
enaznin commentedComment #17
bhogue commentedBTW, I created a module for this: admin_menu_levels