Add a way to edit block content on the block layout page

Created on 15 January 2015, almost 10 years ago
Updated 22 November 2024, 12 days ago

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

Feature request
Status

Closed: duplicate

Version

9.5

Component

block.module

Created by

🇩🇪Germany sachbearbeiter

Live updates comments and jobs are added and updated live.
  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs screenshots

    The change alters the user interface, so before and after screenshots should be added to document the UI change. Make sure to capture the relevant region only. Use a tool such as Aviary on Windows or Skitch on Mac OS X.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇵🇹Portugal luis_oliveira Portugal

    I 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.

    <?php
    if (isset($build[$region][$uuid]['content'][0]['#block_content'])) {
    ?>

    I fixed that and added the "edit" option in the operation metadata.

Production build 0.71.5 2024