Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). Varbase Media Header 9.2.1 Minor update available for module varbase_media_header (9.2.1). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

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.

Activity

Total releases
3
First release
Feb 2026
Latest release
2 weeks ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

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