Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Field formatter attributes

Security covered Under active development 38 sites

This module allows administrators to add custom HTML attributes to the wrapper elements of fields in Drupal's display settings and Layout Builder. It provides an easy way to modify the HTML output without needing to create custom Twig templates for every field.

This module allows site administrators to add additional HTML attributes to the wrapping markup on any field in the Manage Display settings page and in Layout Builder.

Instructions

The field formatter attributes settings are found in the Manage display tab for content types, users, and other entities. A options element is available for each field formatter, revealed by using the formatter settings edit button (Gear wheel icon) for that field.

Finally copy the field.html.twig file into your theme to allow access to all features. Or make your existing template compatible.

Dependencies

No dependencies outside of Drupal core. There is however a field.html.twig file which is recommended for use with this module. It is a drop-in replacement for the core provided template.

Related projects

This module is based on the Field Formatter Class module. It has simply been extended to allow arbitrary attribute name/values to be added.

Ask your assistant about Field formatter attributes

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

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
3
Tracked since
Feb 2026
Latest release
3 months ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
2.0.0-beta2 Pre-release 10–11 Jun 30, 2026
2.0.0-beta1 Pre-release 10–11 Feb 23, 2026
2.x-dev Dev 10–11 Feb 23, 2026