Drupal is a registered trademark of Dries Buytaert
Release: Drupal 10.3.6 Update released for Drupal core (10.3.6)! Release: Drupal 11.0.5 Update released for Drupal core (11.0.5)! Release: Drupal 10.2.9 Update released for Drupal core (10.2.9)! Release: Drupal 10.2.10 Update released for Drupal core (10.2.10)! Release: Drupal 10.3.7 Update released for Drupal core (10.3.7)! Release: Drupal 11.0.6 Update released for Drupal core (11.0.6)! Release: Drupal 10.3.8 Update released for Drupal core (10.3.8)! Release: Drupal 11.0.7 Update released for Drupal core (11.0.7)! Module Revived: Translation Management Tool 8.x-1.19 Module tmgmt updated after 7 months of inactivity (8.x-1.19). Usage Milestone: Account field split Module account_field_split crossed 10,000 active installs.

Purpose

Field Label extends field formatters for most field types to allow customization of field label text (including plural variant), CSS classes and/or field label wrapper tag at the display field formatter level (i.e. per content type, view mode, layout override, etc.). Field Label works with Layout Builder.

Features

Each feature below can be enabled/disabled globally in the module settings according to the needs of the project. Allow authorized users to:

  • Change the field label text
  • Choose a plural label variant for multiple cardinality fields
  • Choose a CSS class for the field label wrapper tag from a configurable list
  • Add one or more "free form" classes to the field label wrapper
  • Choose an HTML tag for the field label wrapper from a configurable list

Permissions

Each feature has an associated permission to provide granular access control. This is useful if you allow content authors to customize pages with Layout Builder layout overrides, but don't want to expose all the features of the formatter settings.

⚠️ Twig template updates may be required

Field Label provides a field.html.twig template that will override core templates only. If your theme implements field templates, you'll need to update them to use the label_tag variable Field Label provides. For example, a typical field template that renders the label like this:

<div{{ title_attributes }}>
  {{ label }}
</div>

Would need to be updated to something like:

<{{ label_tag|default('div') }}{{ title_attributes }}>
  {{ label }}
</{{ label_tag|default('div') }}>

Alternative/Similar Modules

  • Display Suite allows for extensive control over field markup (including label tag and classes) as well as changing the label text, but the 'field template' features are not currently compatible with Layout Builder.
  • Fences also provides more control over field markup, but doesn't allow for customizing label text. Fences works with Layout Builder, but can enable authors to change all field markup if they have access to Layout Builder layout overrides.
  • Entity Form Field Label provides a way to change label text on form displays. (Field Label does not support form displays.)
  • Field Display Label provides an additional label field that is used on all entity displays.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
1
Tracked since
Nov 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 1
Maintenance
Dormant

Releases

Version Type Core Release date
2.x-dev Dev Nov 11, 2024