Problem/Motivation
In EntityDisplayFormBase::getRegions() there is a hard-coded list of region names: 'content' and 'hidden'.
These are added to all of the fields and extra fields.
Also the fields and extra fields are not easy to alter per view mode.
Modules that want to add additional regions need to do one of two things:
- Create two (!) subclasses that extend EntityFormDisplayEditForm and EntityViewDisplayEditForm, and that override the getRegions() method. This is what the experimental field_layout module does.
- Alter the form, and process all of the fields and extra fields, to add the additional region options. This is what contrib Display suite module does.
Both of these options are bad.
Steps to reproduce
Proposed resolution
We could inject an object (a service?) that acts as a region provider.
Or we could invoke hooks that provide regions or alter the existing region list.