Problem/Motivation
Currently the Block items are getting reorganized in the administration menu. Instead of opening a new issue @smulvih2 and I agreed to rescope this issue, which was initially about the same goal, but tried to accomplish that solely in admin_toolbar (the problems see in #8 and #9). The changes introduced with #3318110: [meta] Reorganize Block items in the administration menu will definitely require adjustments for admin_toolbar. Issue identified so far are:
for #2987964: Move custom block types admin link to admin/structure: the menu item custom block types got renamed to block types and moved one level up the hierarchy so it is on the same level like block layout, content types, media types and so on. but under block layouts there is still another menu item block types.
for #2862564: Move Custom block library to Content: on /admin/content the Blocks tab is placed between content and Comments but in admin toolbar custom blocks is placed between comments and files.
Proposed resolution
The issue is set to postponed until the moving and renaming issues in Core are landed otherwise it might lead to unnecessary extra work. I will keep the list of identified issues up to date along the way.
Remaining tasks
User interface changes
API changes
Data model changes
Original report by @smulvih2
Currently all block_content links are added under Structure, see image below:

Feedback on current links added under Structure:
- Add custom block - this is content and not structure, so should be nested under Content
- Block types - keep this menu item where it is since it is Structure, remove this link if drupal/block_content_permissions module is enabled since it provides a more granular menu structure for this.
- Custom block library - this is content similar to the Content overview page, should not be under Structure
Here is what I propose for the block_content links:

New links:
- Blocks - goes to the blocks overview page that lists all custom blocks
- Add block - goes to the page that lists links to add blocks of different types
- List all of the available block_content_type under Add block
| Comment | File | Size | Author |
|---|---|---|---|
| #20 | Screenshot from 2023-06-23 09-45-58.png | 6.54 KB | neclimdul |
| #6 | admin-toolbar-block-content-3317639-6.patch | 2.38 KB | smulvih2 |
| #2 | admin-toolbar-block-content-3317639-2.patch | 2.04 KB | smulvih2 |
| Screenshot from 2022-10-26 11-17-05.png | 33.58 KB | smulvih2 | |
| Screenshot from 2022-10-26 11-10-02.png | 27.5 KB | smulvih2 |
Issue fork admin_toolbar-3317639
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:
Comments
Comment #2
smulvih2Patch to implement changes to block links.
Comment #4
lbonfioli commentedComment #5
lbonfioli commentedHello, good job @smulvih2, I've tested and the toolbar is working as intended; moving to RTBC.
Comment #6
smulvih2I realized I made this patch when I had the drupal/block_content_permissions module enabled, which provides a replacement for the
entity.block_content_type.collectionroute link. This means my patch above, when used without drupal/block_content_permissions, removes the Block types UI link.New patch checks for the drupal/block_content_permissions module, and if not enabled will include this link. If the drupal/block_content_permissions module is enabled it provides a better menu structure for this link as it also includes the ability to drill down into the sub-options like Manage fields, Manage form display, etc...
Comment #7
smulvih2Comment #8
rkollerI've applied the patch and taken a look. Unfortunately the approach has one fundamental flaw. If you click in the admin toolbar on
content->blocksthen the path of the page you are directed to shows/admin/structure/block/block-contentand its breadcrumbhome > administration > structure > block layout. Meaning the user is first in the top level menu item/admin/contentbut the page the user ends up is under/admin/structure. that is a potential source for confusion.If you go to
block typesin the admin toolbar menu the second level nav item next toblock typeson the left is alsoblocks. it points to the same page you get to when clickingblocksundercontent. so two different menu items in two different sections (content & structure) pointing to the very same page.In general I completely agree with the need and the effort to solve the problem caused by the current representation of blocks under the top level menu item structure. But I think that the problem should better be solved in Core. There are actually two issues that got momentum again two or three days ago, thanks to @smustgrave, solving that exact problem.
When I was taking a look at the current state of those issues one of the problems was that there were some discrepancies with menu items that admin_toolbar probably hasn't created dynamically and therefore there was a disconnect with the changes the patches introduced.
for #2987964: Move custom block types admin link to admin/structure: the menu item
custom block typesgot renamed toblock typesand moved one level up the hierarchy so it is on the same level likeblock layout,content types,media typesand so on. but underblock layoutsthere is still another menu itemblock types.for #2862564: Move Custom block library to Content:the
custom block librarygot moved over tocontent. in yesterdays ux meeting #3316853: Drupal Usability Meeting 2022-10-28 there was also the idea and discussion to change the naming ofcustom block libraryandcustom blocks(that isn't reflected in #2862564: Move Custom block library to Content yet). on/admin/contentthecustom blockstab is placed betweencontentandcomments. but in admin toolbarcustom blocksis placed betweencommentsandfiles.there was an agreement to open an issue about the matter in the admin_toolbar issue queue. @smustgrave suggested to open an issue and postpone it until the two issues are landed in Core. so i went into the admin_toolbar issue queue tonight. that's where i've noticed the issue here.
The question now is how you would like to proceed? Would you prefer that i open a new issue for the necessary changes those linked issues in Core entail and let credits be moved over from this issue, or better rescope this issue or go with another option you would have in mind? Just wanted to avoid double work for anyone involved nor make any decisions over anyones head.
Comment #9
smulvih2@rkoller thanks for linking to the core issues and your summary! I did realize after testing my patch that the routes are still /admin/structure/* which requires a core change to align with changes in this ticket. I'm in favor of re-scoping this issue and it being dependent on core changes in the linked issues.
Comment #10
smulvih2Comment #11
rkollerThanks @smulvih2! I'll remove the related issue and set the issue as child of the overall meta issue reorganizing the block items in the administration theme. cuz the admin_toolbar issue not only applies to the "moving the custom block library to content" but also to "block types" and "block layout". making it the child of the meta would cover everything.
Aside that i think the title would have to reworded to reflect the new scope as well as an update to the issue summary is need. for the moment i would say to add the two paragraphs from #8 to the proposed resolution section with the note that it might entail more changes as soon as the the move of block layout gets implemented as well.
and i am not sure about the correct form. but if an issue gets postponed blocked by one or more other issues would it have [P-1] prepended?
Comment #12
rkollerComment #13
aaronmchaleI think this is now only postponed on #3318112: [PP1] Move "Block layout" from Structure to Appearance and possibly #3318549: Rename Custom Block terminology in the admin UI.
Comment #14
rkollerthanks for updating the issue aaron! this issue has definitely to be placed after #3318549: Rename Custom Block terminology in the admin UI until the micro copy (and the h1s in particular) is agreed on. i was already thinking about adding an update to the issue here yesterday after the "moving the block library to content" issue has landed but i have struggled picking the right PP level. but it feels like PP-2 is the correct pick.
Comment #15
aaronmchaleThanks @rkoller. In terms of the "PP-X" level, the way I approach it is it should be the number of issues that this issue is directly postponed on, in this case 2 issues, even though one of them is postponed on another issue that doesn't really matter for this issue, otherwise it just ends up being a bit hard to track what is postponed on what.
Comment #16
rkollerJust a heads up. The first alpha of Drupal 10.1 is getting close (scheduled for the 24th of april). The last two issues (#3318112: [PP1] Move "Block layout" from Structure to Appearance & #3318549: Rename Custom Block terminology in the admin UI) currently blocking this issue should hopefully getting finalized and being committed in the upcoming days.
Comment #17
rkoller#3318549: Rename Custom Block terminology in the admin UI got in today so only one blocking issue left.
Comment #18
rkollerWe might already start discussing how to approach the necessary changes. how about the following.
Content:
the cleanest option might be like already suggested in the issue summary
https://www.drupal.org/files/issues/2022-10-26/Screenshot%20from%202022-...
it just looks odd having a single menu item under blocks and then under that several block types (depending on the number of block types created). the only
necessary change to the screenshot, the label for the add menu item shouldnt be
Add custom blockbutAdd content block.Structure:
the menu item
block typesunder structure is already displayed correctly. the only detail i would suggest to change is adding aAdd block typemenu item that the available options are consistent with for example content types.Appearance:
at the moment the
block layoutmenu item under appearance still has theadd custom block,block types, andcustom block librarysubmenu items. removing those three would be the logical step. but i wonder if it would make sense to make the secondary nav tabs forblock layoutavailable as menu items instead like done for thesettingsmenu item under appearance.the only problem, for
settingsthere is the defaultglobal settingstab that is reached when the parentsettingsmenu item is clicked while you see the child menu items forclaroandolivero. but forblock layoutyou would reacholiverowhen clickingblock layoutmenu item and you would only haveclaroas the sole child menu item. sort of suboptimal. :/Comment #19
rkollerI am moving this issue to
Needs work now. Drupal 10.1 RC1 is out and #3318112: [PP1] Move "Block layout" from Structure to Appearance got postponed on #2755613: Restructure the admin interface Information Architecture today after it was hanging in RTBC for quite a while. That way this issue should focus only on the first two points in #18 (with a small addition for the point about structure i've missed before):Content:
the cleanest option might be like already suggested in the issue summary
https://www.drupal.org/files/issues/2022-10-26/Screenshot%20from%202022-...
it just looks odd having a single menu item under blocks and then under that several block types (depending on the number of block types created). the only
necessary change to the screenshot, the label for the add menu item shouldnt be
Add custom blockbutAdd content block.Structure:
block typesunder structure is already displayed correctly. the only detail i would suggest to change is adding aAdd block typemenu item that the available options are consistent with for example content types.Block Layoutunder structure would have to be removed.In regards of the Block Layout move a new issue could be opened as soon as there is a final consensus about the new location.
Comment #20
neclimdul" the label for the add menu item shouldnt be Add custom block but Add content block."
The text is actually just "Blocks."
At least this one is easy. The text mentioned is in the module currently and being removed.
This is the new layout in the patch:
Comment #21
j. commentedPatch from #6 is really helpful. I though i was loosing my mind because i couldn't find these "new links" after the changes in 10.1 Thank you!
Comment #22
bwaindwain commentedComment #24
prashant.cApplied changes from #6 to the fork.
The branch has some JS issues like
$(...).once is not a functionwhich is causing the "Admin Toolbar quick search" to stop working, tested on Drupal10.1.7.Comment #25
japerry