Problem/Motivation

Make it possible to pull in fields from referenced entities in a display view mode.

Drupal is very strong in building data-structures with the entity_reference module.
Might it be possible to use these structures in view-modes?

Some examples of Drupal data-structures with relationships to other entities:
1. An article (type node):
- an author (type user)
- some tags (type taxonomy_term)
2. A page (type node):
- some paragraphs (type paragraph)
- an author (type user)
3. A product (type commerce_product):
- an author (type user)
- a store (type commerce_store)
- variations (type commerce_product_variation)

When creating a view-mode for those 3 things (article, page, product), currently you cannot 'drill down' to fields that are attached to the references entities (user, store, paragraph).

Currently a module like Display Suite leverages the 'extra_fields' hook. That hooks lacks lot's of functionality from 'real' fields (doesn't use field-formatter settings).
It also needs custom coding per-field.
It kinda works for a field like 'author name' (every site has it), but it won't work for any non-standard field.

Proposed resolution

Add an option a-like Views to add a "Relationship" to a Display view mode via the entity_reference fields.
When you do this, all fields from the referenced child-entity are then available like they are 'normal' fields that belong to the parent-entity.
It should include field-formatter settings per view-mode and also the relationship should be drillable (node->user->group->...).

Remaining tasks

User interface changes

API changes

Data model changes

Comments

ndf created an issue.