Add bundle derivatives like admin_toolbar_tools

Created on 31 October 2024, about 2 months ago

Problem/Motivation

Nice module! This doesn't entirely replace admin_toolbar_tools, however -- we're noticing a bunch of child links have disappeared after disabling that module and enabling this one. Most noticeable in our case was getting a link to each vocabulary under Structure -> Taxonomy -- with admin_toolbar_tools, you get a link on the nav menu for each vocabulary, whereas with this module none of these appear.

Steps to reproduce

With admin_toolbar_tools, view the structure menu and see a lot more expandable sections with individual bundles nested below -- comment types, content types, menus, taxonomy, webforms, views all are expandable.

Enable this module and disable admin_toolbar_tools, and all those menu items disappear.

Proposed resolution

I think the code generating these for admin_toolbar_tools is here: https://git.drupalcode.org/project/admin_toolbar/-/blob/3.x/admin_toolba...

This can probably be adapted to run in this module.

Remaining tasks

... port this code over to your module!

User interface changes

Many more supporting links on the admin menu, particularly under Structure.

API changes

N/A.

Data model changes

N/A.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇺🇸United States freelock Seattle

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @freelock
  • 🇮🇪Ireland lostcarpark

    Thank you for raising this issue.

    I didn't realise how much admin_toolbar_tools does when I started this, and I was a bit surprised to see the plugins as part of it. The main functionality I was missing was clearing caches and running cron, so that's what I focused on.

    I was intending to go back and figure out what the plugins were doing. I had made lots of use of the submenus under Structure, but never realised they were coming from admin_toolbar_tools!

    As this adds a bunch of submenus, I'll need to make sure it does it in a way that keeps the higher level menu items selectable, as I've found Navigation tends to make items with submenus only open and close the submenu, and not be selectable themselves.

    I think my priority is to get a 1.0.0 stable release, but this definitely looks like a feature worth adding for 1.1.

  • 🇮🇪Ireland lostcarpark

    Changing version to 1.1 as new feature.

  • 🇮🇪Ireland lostcarpark

    I'm aiming to work on this soon, but as a first step, I've added functionality to add the Development menu from the Devel module to the Tools menu, under issue Expose Devel menu to inside the Tools menu Active .

    As a lot of the code is common with this change, I'm waiting for it to be merged to start on this one.

    One issue with the Navigation menu currently is menus with submenus are no longer clickable, as top items with submenus only open and close the menu on the level below. This would be a problem if adding a list of views under the "Structure->Views" menu item would make the Views menu no longer selectable.

    My current thought is that Navigation Extra Tools would add a new item, "Views administration" under the current Views item, that would take you to the same route, then add the list of views below that. That would mean one extra click to get to the Views admin page. Would that be an bother people?

    I might also add "New view" on that list so you could skip the views admin page and go straight to add a new view.

  • 🇮🇪Ireland lostcarpark

    I'm working on this issue now.

  • 🇮🇪Ireland lostcarpark

    Currently, Navigation is limited to a maximum of 3 levels. This is going to limit us, as Admin Toolbar Extra Tools adds many 4th level menu items.

    Where practical, I can add them as 3rd level items for now. For example, Admin Toolbar Tools adds items for managing fields and display under "Config->People->Account Settings". For now, I've added these items at the 3rd level for now.

    However, there are other 4th level items where this isn't practical. For example, a third level item for each user role is added under "People->Roles". Admin Toolbar Extras adds "Permissions", "Delete", and "Devel" options as 4th level items under these. I think trying to add these at the 3rd level would be unwieldy, so I'm deferring for now.

    There is an issue open to add 4th level menus to Navigation 💬 Support Deeper Navigation Levels Active , but it doesn't look like much has been done on it yet.

    For now, I think we'll just have to live with this limitation.

  • 🇺🇸United States freelock Seattle

    Unfortunately the code in the MR is not working for me...

    Regarding 4th level menu items, if you add them as a 4th level do they just not show up? If so, seems like that would be the right solution -- they are there when the upstream adds that functionality...

    Cheers,
    John

  • 🇮🇪Ireland lostcarpark

    The initial check-in was just some reorganisation of the ToolsMenuDeriver class so that child menus are added by logically named methods rather than a single monolithic one. I created the MR just to check that the change still pass the automated testing before starting on new functionality.

    The latest commit adds child options to the "People" menu, including listing all the roles under the Rolls option, as well as adding options to the "Config->People" menu. The "Manage user fields", "Manage user form display", and "Manage user display" options ought to be 4th level items, but I've placed them as 3rd level for now.

Production build 0.71.5 2024