Provide Label View mode option on the referencing entity

Created on 25 May 2023, almost 2 years ago
Updated 3 November 2023, over 1 year ago

Problem/Motivation

I was expecting (and it would be a common usecase to have) the core's formatter options (especially the linked label) to be available in the View mode config field, so that one would see a default short representation of the referenced entity before clicking it to open the bigger version in the dialog (controlled by the View mode in dialog config).

Currently, one would often have to create a new view mode just for using this field formatter, as I imagine this common usecase:
Default (full) view mode: on the entity's page
Teaser view mode: in the dialog
Label (linked to the dialog): in the referencing entity.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

🇮🇹Italy kopeboy Milan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kopeboy
  • 🇮🇹Italy kopeboy Milan

    In general, one wouldn't expect the "dialog formatter" to format the non-dialog entity.

    Since i'm a noob dev I'm not sure if this was intended or necessary.

  • 🇨🇦Canada phjou Vancouver 🇨🇦 🇪🇺

    @kopeboy
    You can achieve this by creating a "label" view mode, and displaying only the label on that view mode. You can then select it in the field formatter.
    But I agree it would be an interesting feature to avoid that view mode creation step.

    I am not sure that it is mandatory for entities to have a label, I'll need to double check how core is doing it (if it is only for terms and nodes).
    This module tries to stay as general as possible, but we need to look into it.

Production build 0.71.5 2024