Problem/Motivation

In #2374019-7: Cleanup the use of custom item properties in EntityReferenceFormatterBase @yched said

dynamic_entity_reference is its own field type, different from core's entity_reference, and thus cannot use its formatters and widgets (that assume that all entities are of the same entity type).

And he suggested

if we had a static ERItemList::loadReferencedEntities(ERItemList[]) that both $items->referencedEntites() and ERFormatterBase::prepareView() used, as we discusssed in #2370703: ER's "autocreate" feature is mostly broken (and untested), then dynamic_entity_reference could simply override that static method, ERFormatterBase would work, and dynamic_entity_reference wouldn't require re-implementing all formatters :-)

So this got me thinking why not allow user to choose per entity_type formatters.

Proposed resolution

Allow user to chose per entity type formatter. Same as #2346273: Allow user to select bundles per entity type on field settings page but for formatters.

Remaining tasks

  1. Is it possible?
  2. Workflow?
  3. Implementation.
  4. Tests.
  5. Review.
  6. Commit.

User interface changes

User will have the ability to choose the per entity type formatter in formatter settings.

API changes

API addition only

Comments

jibran’s picture