Field Label formatter settings
Field Label module configuration page
Field Label permissions

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.

Project information

Releases