Field formatter attributes
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.
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
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 2.0.0-beta2 | Pre-release | 10–11 | Add list options to tag selection | Jun 30, 2026 | |
| 2.0.0-beta1 | Pre-release | 10–11 | Feb 23, 2026 | ||
| 2.x-dev | Dev | 10–11 | Initial port to Drupal 10/11 | Feb 23, 2026 |