Problem/Motivation
After adding a custom block you can find the custom block in the list of admin/structure/block, but you are not provided with a link to edit this block.
To actually edit the block you have to switch to the "Custom block library" admin/structure/block/block-content, to find the contextual "Edit" link you are looking for.
This is very puzzeling, especially if you manage to create your new block on admin/structure/block by clicking "Place block" near a region header and follow "Add custom block" in the dialog. This way you are able to create a block without ever visiting the "Custom block library".
Proposed resolution
Add an "Edit" link for custom blocks in admin/structure/block.
Remaining tasks
- Add contextual links
- Write/adapt tests
User interface changes
- Custom block have an extra link in the list of admin/structure/block.
Original issue summary
Referring to http://drupal.stackexchange.com/questions/144133/contextual-links-for-cu...
"I have created a custom block type and it would be wonderful to have a link in the block dropbutton: "Edit block content"."
thanks and regards
sb
| Comment | File | Size | Author |
|---|---|---|---|
| #36 | add-edit-link-in-layout-builder-2407761-36.patch | 1.58 KB | luis_oliveira |
Comments
Comment #1
larowlanComment #2
grendzy commentedI believe this has been fixed: #2284917: In-place editing of custom blocks broken *again* (because attributes and contextual links of custom blocks are lost)
Comment #3
g.oechsler commentedThis is not a duplicate of #2284917: In-place editing of custom blocks broken *again* (because attributes and contextual links of custom blocks are lost).
This is about the contextual links on admin/structure/block.
I updated the summary to point out the issue.
Comment #4
g.oechsler commentedComment #5
g.oechsler commentedHere's a first shot at this.
Let's see what the testbot thinks of it.
Comment #6
lewisnymanComment #7
lewisnymanComment #8
olli commentedThis sounds like #2331603: Where to edit the contents of a custom block is not discoverable.
Comment #9
MattA commentedI don't really think hard-coding support for only the block_content.module in block.module is the way to go. Looks like #1956134: Provide helpful editing links on "admin/structure/block" for deriver blocks (menu, views, block content, etc.) had a generic implementation that would have supported menus and views too, but
OperationsProviderInterfaceis no longer used anywhere in core, so that won't work anymore.Comment #10
Bojhan commentedThis needs a screenshot.
Comment #11
tim.plunkett@LewisNyman Can you elaborate why you moved this to a task? Still reads like a feature request to me.
Either way, not a bug fix.
Comment #12
lewisnyman@tim.plunkett hmm good question. I can't remember and it doesn't seem clear to me looking at the issue summary. Let's change it back in that case.
Comment #20
murzSame UI problem with editing block content also have
Layout Builderedit page. Custom blocks can be edited only via small right sidebar, that have very little width. Will be good to have also contextual link to full block edit page.Comment #21
andriyun commentedRerolled patch #5
Comment #23
Oscaner commentedI add an "Edit" contextual link for content block in layout screen, this can redirect to the block edit screen.
Comment #24
Oscaner commentedComment #25
no74hHi, I edited patch in #23 to also support core (edit, translate..) contextual links in layout edit page for block content types and their translations.
Comment #26
Oscaner commentedChange the #23 patch to only block_content block, no inline_block.
Comment #27
no74hI opened a related issue for fixing comment #20 demand. https://www.drupal.org/project/drupal/issues/3106035
Comment #30
maithili11 commentedSome changes in the #23 patch to work with 8.9.9.
Comment #33
anybody#1956134: Provide helpful editing links on "admin/structure/block" for deriver blocks (menu, views, block content, etc.) looks like a (better as more general) duplicate to this issue. Keeping this postponed, but after that issue was fixed, we should check to close this as duplicate.
Comment #35
smustgrave commentedSo this functionality is being applied to https://www.drupal.org/project/drupal/issues/1956134. So I'm closing as a duplicate and will leave a comment in https://www.drupal.org/project/drupal/issues/1956134 for credit to be moved over.
If anyone feels this is a separate issue please reopen with explanation of difference.
Thanks.
Comment #36
luis_oliveira commentedI used patch #30 but did not work, I did some debugging and found out that in Drupal 10 the array key 0 does not exist so the if statement would be skipped.
I fixed that and added the "edit" option in the operation metadata.
Comment #37
luis_oliveira commented