- Issue created by @pdureau
- 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 🇫🇷
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.
- Merge request !101Draft: Issue #3529245 by grimreaper, pdureau, mogtofu33: WIP: Add "content edit" panel → (Open) created by Grimreaper
- 🇫🇷France Grimreaper France 🇫🇷
First draft only default form mode.
For later:
$form = $this->entityFormBuilder() ->getForm( $entity, $formMode] );
$formMode is an entity type form handler.
- 🇫🇷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.