Allow changes to Label property label in the UI

Created on 21 July 2022, almost 2 years ago
Updated 21 October 2023, 8 months ago

Problem/Motivation

Currently the Microcontent has a "Label" field but it doesn't make sense for us to always have the label of "Label". For example, for an Author microcontent, we'd love to use a label of "Name" instead without having to form alter it.

Steps to reproduce

Proposed resolution

Provide configuration on the microcontent type, like node types, to configure the label property's actual label.

Remaining tasks

User interface changes

API changes

Data model changes

✨ Feature request
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Dave Reid Nebraska πŸ‡ΊπŸ‡Έ

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.

  • πŸ‡¦πŸ‡ΊAustralia sime Canberra

    This tip in #3 works really well and I thought it helpful to describe it in a different way for some readers. I'll mark this as works as designed, because it's not unusual for Drupal functionality to not have a UI (hello twig debugging) but it can be reopened if anyone was contributing a patch to expose this to the UI.

    Say your bundle is "foobar" and you want to change "Label" to "barfoo". You'll see a new yaml file core.base_field_override.microcontent.grant.label.yml

    And the contents will look like this.

    langcode: en
    status: true
    dependencies:
      config:
        - microcontent.type.foobar
    id: microcontent.foobar.label
    field_name: label
    entity_type: microcontent
    bundle: foobar
    label: barfoo
    description: ''
    required: true
    translatable: true
    default_value: {  }
    default_value_callback: ''
    settings: {  }
    field_type: string
    

    You can create this file by hand, but better to follow the instructions in the link to generate this file.

Production build 0.69.0 2024