Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: Drupal 11.3.18 — Update released for Drupal core (11.3.18)! Release: UI Icons 2.0.1 — Minor update available for module ui_icons (2.0.1). Release: Gemini Provider 1.1.0 — Minor update available for module gemini_provider (1.1.0). Usage Milestone: Svg Image — Module svg_image crossed 100,000 active installs. Release: Content filter 1.0.2 — Minor update available for module content_filter (1.0.2). Release: Self-Hosted QR Code Generator 2.0.4 — Minor update available for module qr_generator (2.0.4). Release: Cucumber User Roles 12.0.3 — Minor update available for module cucumber_user_roles (12.0.3). Release: Webform GeoIP Restriction 1.1.9 — Minor update available for module webform_geoip_restriction (1.1.9). Release: SMSFactor for SMS Framework 3.0.0 — Major update available for module sms_smsfactor (3.0.0). Module Revived: Webform Simplenews Handler 2.0.5 — Module webform_simplenews_handler updated after 12 months of inactivity (2.0.5).

Element Class Formatter

Security covered Drupal 10–11
View on drupal.org

Overview

A collection of field formatters which add classes to various elements (as opposed to the wrapper markup).

Features

  • Text wrapper - add a wrapper HTML tag with classes to any Text field.
  • Link class - add classes to any Link fields anchor tag.
  • Entity reference label class - add classes to the Label display of an Entity Reference field.
  • Email and Telephone class - add classes to the anchor tag of a Telephone and Mail link.
  • File, Image and Responsive Image class - add classes to a File link or Image tag.
  • Lists - create a HTML list out of Text and Link fields with a class on it.

Requirements

Field

Similar modules

Field formatter class provides field formatters to add classes to the outer HTML wrapper for any field display. This module differs in that it adds the classes to the field element itself, instead of the fields wrapper. Wrapper classes are easier to add via Twig than element classes are.

Fences and Display Suite provides way more options for classes and markup. If you want full control over markup as a sitebuilder use one of these. If most of your markup lives in twig templates and you just want to quickly add classes to the actual element, use this module.

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
1
Tracked since
Sep 2026
Latest release
6 hours ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Releases

Version Type Core Release date
2.1.3 Stable 10–11 Sep 29, 2026