Problem/Motivation

We have a site that uses the group module with ~200 groups and each group has its own menu. That means admin_toolbar adds 3 menu links for each menu, which results in 600 links and displaying those is a big performance issue for us.

Proposed resolution

There are a few options, not sure what's preferred:

a) Only add the first ~10/20 menus/node types/.., whatever makes sense.. if there are too many to display on even a big screen, it's pointless anyway .
b) Allow to configure which things should be added to the menu at all.

I'm just adding a stop-gap for now that completely disables it for menus.

Remaining tasks

User interface changes

API changes

Data model changes

Comments

Berdir created an issue. See original summary.

berdir’s picture

Status: Active » Needs review
StatusFileSize
new577 bytes
adriancid’s picture

Thanks for report the issue. I think we can add only 20 elements and as 21th element a link to the parent with the label as 'See all' or something like this. What do you think?

berdir’s picture

Fine with me.

That said, on my 1920x1200 screen, I can currently see ~17 menu links (as Menus is already the 6th and it goes only down from there), so the 21th wouldn't ever be visible for me, there's also always the parent to see the overview?

oknate’s picture

If you actually want to see all of the subitems, I've been working on a module, entity_toolbar, that builds on admin_toolbar_tools and moves the links under entity.group_types.collection (for example) to a separate toolbar, breaks them up into groups of no more than seven and lazy loads them from an ajax endpoint.

I've worked on a few sites where there were quite a few paragraph bundles, and this approach makes it easier to reach the "manage display" or "manage fields" for the bundle, where normally after a certain number of bundles, they go below the fold in the administration toolbar.

Entity Toolbar helps reduce the page load time mentioned in this ticket, because in hook_menu_links_discovered_alter() I move the links under the bundle collection route out of the administration menu and move them to a new menu. This prevents the administration menu from getting too large, and thus improves the load speed of the administration toolbar. The new entity type toolbars are lazyloaded and then cached, which speeds things up without losing access to those links in the toolbar.

As far as the entity_toolbar_tools module goes, I think a config where you could select which entities you want expanded and which you don't would be nice.

oknate’s picture

Adding a config to disable some of the expensive links. This is also a stop-gap measure. I'm not sure how to fix breaking BC with this, but I want it for our current site. I thought I'd disable admin_toolbar_tools for our production site, but there are some things we want, such as the add content links, so making it configurable is a good idea. It needs more work, but it solves my problem for now, and gets the ball rolling.

settings

oknate’s picture

Ignore the last patch, it was full of bugs because I was in a rush.

oknate’s picture

Updated. On the current site I'm working on, we're moving out of the dev phase and will launch soon. Using patch #8 with only "Add Node links" enabled, the number of links in the admin toolbar was reduced from 2247 links to 734 links. In our case, we don't have a lot of menus, but we have a lot of paragraph types.

adriancid’s picture

@oknateI I think that this issue is covered in the new 8.x-2.x version if this is the case we can close this issue?

oknate’s picture

Status: Needs review » Closed (outdated)

Yes, I think we can close this, perhaps even mark it fixed with a link to the other issue where it was fixed.

I still think there may be some value in the config I created, if someone wants to suppress certain types of links. But that's a side issue, and I'll create a new issue for it, when and if I think I need it.

socialnicheguru’s picture

So if you are still using 1.x version this patch is still needed but if you are using 2.x version it is not?

adriancid’s picture

Yes