Skip to main content
drupalreleases
Release: Cms 2.2.3 — Update released for Drupal core (2.2.3)! Release: Easy Breadcrumb 2.0.11 — Minor update available for module easy_breadcrumb (2.0.11). Release: Bootstrap 8.x-3.42 — Minor update available for theme bootstrap (8.x-3.42). Release: Editoria11y Accessibility Checker 3.0.10 — Minor update available for module editoria11y (3.0.10). Release: Editoria11y Accessibility Checker 2.2.24 — Minor update available for module editoria11y (2.2.24). Release: Leaflet 10.4.13 — Minor update available for module leaflet (10.4.13). Release: Flag 5.1.1 — Minor update available for module flag (5.1.1). Release: Layout Paragraphs 3.0.0-beta5 — New beta version released for module layout_paragraphs (3.0.0-beta5). Module Revived: Bootstrap 8.x-3.41 — Theme bootstrap updated after 6 months of inactivity (8.x-3.41). Security Coverage: Component Library — Module component_library now has official Drupal security advisory coverage.

Field Formatter Class

19,403 sites Security covered Drupal 10–11
View on drupal.org

This module allows you to add custom CSS classes to the HTML wrapper of any field display. This makes it easier to style fields with CSS or target them with JavaScript, which is especially useful for integrating with CSS frameworks or JavaScript plugins.

πŸ‡ΊπŸ‡¦

This module is maintained by Ukrainian developers.
Please consider supporting Ukraine in a fight for their freedom and safety of Europe.

Allows site administrators to add classes to the outer HTML wrapper for any field display, so that CSS and Javascript can target them.

It's particulary useful for adding classes required by various jQuery plugins and CSS grid systems.

Instructions

The Field Formatter Class settings are found in the Manage display tab for content types, users, and other entities. A text box is available for each field, revealed by using the formatter settings edit button (gear wheel icon) for that field.

The class is added to the outer <div> container for the field. The default Drupal field classes (e.g. "field-type-taxonomy-term-reference") remain available - this module does not remove any classes.

The accompanying screenshot images show the settings form and some example HTML output.

This module works well in tandem with Field Group. Note that this module only adds classes to field formatters; to add classes to field groups, use the settings provided by the Field Group module.

Tutorials

Known Issues

There is a compatibility problem when using this module in combination with the extra fields provided by Display Suite. The issue potentially affects all modules which implement Field formatter settings API, and a solution is being explored in the Display suite project.
See #1616426: Compatibility with Display Suite

Depends on

Dependencies of the latest stable release

  • field Drupal core

Required by

2 tracked projects depend on this one

Activity

Tracked releases
3
Tracked since
Aug 2024
Latest release
6 months ago
Releases (12 mo)
1 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
8.x-1.9 Stable 10–11 Mar 26, 2026
8.x-1.8 Stable 10–11 Aug 28, 2024
8.x-1.7 Stable 10–11 Aug 27, 2024