Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 314084

Make regions and fields pluggable or alterable in EntityDisplayFormBase

$
0
0

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.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 314084

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>