Allow changes to Label property label in the UI

Created on 21 July 2022, over 2 years ago
Updated 21 October 2023, about 1 year 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 USA

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 Melbourne

    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.71.5 2024