See also #3389432: Make regions and fields pluggable or alterable in EntityDisplayFormBase
Problem/Motivation
In EntityDisplayFormBase, the table rows are made up from fields and extra fields found in the target entity.
Both of these exist per entity bundle, not per view mode.
Modules like field_group, that want to insert custom rows into the list, have to do acrobatics with hook_form_alter(), where they have to deal with the implementation details of the field_ui form.
The same problem would occur for a hypothetical module that wants to insert separators or other custom items into a view mode or form mode.
Steps to reproduce
Proposed resolution
Provide an API for modules to insert items into a display mode, without extending the form class.
These items can be groups or "leaf" items.
TBD:
One question is whether we can insert items dynamically, without saving anything, based on the form state.
E.g. if a field group module would provide a button "Add group", can we add the group with ajax, without saving the display mode?
Comments
Comment #2
donquixote commented