Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Field Label

Security covered Under active development 1,296 sites

This module allows you to customize field labels for various field types, including changing the text, adding plural variants, and specifying CSS classes and HTML tags for the label wrapper. It integrates with Layout Builder and provides granular permissions for controlling these customizations.

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.
Drupal 8–11

Ask your assistant about Field Label

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

  • field Drupal core

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

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

Release Timeline

Releases

Version Type Core PHP Release date
2.x-dev Dev 8–11 Nov 11, 2024
8.x-1.5 Stable 8–11 Jul 31, 2024
8.x-1.4 Stable 8–10 Feb 6, 2024
8.x-1.3 Stable 8–10 Jan 4, 2024