[1.0.0-alpha2] Add "content edit" panel

Created on 9 June 2025, 4 months ago

Problem/Motivation

Display Builder is not a content editor and doesn't replace the content entity edit form.

However, similar solution are providing this feature and it seems easy to add.

Proposed resolution

Add a new island panel:

  • With the unaltered content entity edit form
  • Every change save the entity
  • Only displayed when content edit context (so only in entity display overrides)
  • Only displayed in default and full displays (default and full are often the same but not always) ?
  • What would be the settings of this panel? (once [1.0.0-alpha1] Make Island plugins configurable Active is ready)
Feature request
Status

Active

Version

1.0

Component

display_builder_entity_view

Created by

🇫🇷France pdureau Paris

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

Merge Requests

Comments & Activities

  • Issue created by @pdureau
  • 🇫🇷France pdureau Paris

    Anybody can take this ticket :)

  • Issue was unassigned.
  • 🇫🇷France pdureau Paris

    Moved to beta phase because it is both:

    • a nice-to-have feature
    • a follow-up of {#3529125]
  • 🇫🇷France pdureau Paris

    As a next step inside this issue or in a follow-up (if so, let's not forget to create the issue), we can use Display Builder to replace the preview system of nodes (which is not very practical and specific to nodes):

    For every fieldable content entity type (only the ones with default display managed by Display builder or we don't care?), we replace the default edit form by an hardcoded (?) configuration of Display Builder with only 2 panels:

    • the content edit panel from this issue
    • the preview panel
  • 🇫🇷France Grimreaper France 🇫🇷
  • 🇫🇷France Grimreaper France 🇫🇷

    Every change save the entity

    I don't think this is a good idea, when revisions are enabled and forced like when a content entity is in a content moderation workflow, this will make the revision number skyrocket.

    Maybe we need a special route, like what node preview does, it handles a temporary storage of the content when clicking the preview button, the node form store the form_state (which contains the entity) and core/modules/node/src/ParamConverter/NodePreviewConverter.php extract the entity from the temporary storage.

    public function convert($value, $definition, $name, array $defaults) {
        $store = $this->tempStoreFactory->get('node_preview');
        if ($form_state = $store->get($value)) {
          return $form_state->getFormObject()->getEntity();
        }
      }
    
    What would be the settings of this panel?

    One settings could be the form mode selection. So we can display the panel for any entity view display, people could configure display builders with different form mode for this panel, matching the fields the corresponding view mode uses.

  • 🇫🇷France Grimreaper France 🇫🇷

    Need to decline the form mode selection per entity type.

    And also maybe per entity type then per bundle.

  • Pipeline finished with Failed
    28 days ago
    #589033
  • 🇫🇷France Grimreaper France 🇫🇷

    First draft only default form mode.

    For later:

    $form = $this->entityFormBuilder()
      ->getForm(
        $entity,
        $formMode]
      );
    

    $formMode is an entity type form handler.

  • Pipeline finished with Canceled
    28 days ago
    Total: 85s
    #589245
  • 🇫🇷France Grimreaper France 🇫🇷

    As discussed with @pdureau, maybe convert entity view overrides into a entity form handler.

  • 🇫🇷France pdureau Paris

    Work in progress.

    Some notes:

    • The new plugin belong to entity_view sub module
    • Form mode selection belong to entity view display form
    • A new event: "content update" registered by only Builder & Preview.
Production build 0.71.5 2024