Add config action for EntityDisplayBase::setComponent()

Created on 17 August 2022, about 2 years ago
Updated 23 February 2024, 9 months ago

Problem/Motivation

A common configuration action requirement is to add a field to an existing entity form or view display.

For example, in #3301370: Model core's standard install profile as recipes β†’ , to make the tags field an optional enhancement to the article content type, an article_tags recipe would add a tags field to entity displays provided by an article recipe.

Proposed resolution

Expose EntityDisplayBase::setComponent() as a config action.

Singular:

core.entity_view_display.node.page.default:
  setComponent:
    name: field_content
    options:
      type: entity_reference_revisions_entity_view
      label: hidden
      settings:
        view_mode: default
        link: ''
      third_party_settings: {  }
      weight: 10
      region: content

Plural

core.entity_form_display.user.user.default:
      setComponents:
        -
          name: field_last_password_reset
          options:
            type: datetime_default
            weight: 4
            region: content
            settings: {  }
            third_party_settings: {  }
        -
          name: field_password_expiration
          options:
            type: boolean_checkbox
            weight: 3
            region: content
            settings:
              display_label: true
            third_party_settings: {  }
✨ Feature request
Status

Fixed

Version

10.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada nedjo

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024