Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Entity body class

Security covered Under active development 61 sites

Part of the Entity ecosystem · 306 projects

This module allows you to add custom CSS classes to the body tag for specific content items. It provides a field for most content types, enabling you to easily style individual pages based on their content. You can control who can set these classes and configure default values.

Provides a new "Body CSS class(es)" field for all entity types. The value of the field will be added as a class for the body tag on the entity page.

Entity types:

The module supports all entity types that have canonical routes. e.g. Node, Taxonomy term, User, Comment, Media, etc.

Permissions:

You can configure who can see the field on the form by managing the Manage body class fields permission.
You can configure who can add default values on the /admin/config/content/body-class-settings page by managing the Manage body class settings permission.

Form display:

The module adds a base field that can be hidden by moving it to the disabled region on the manage form display page.
There is a validation callback for the field to filter values against XSS. The field also supports tokens.

Maintainers:

This project is originally written by AstonVictor.

Drupal 8–11

Ask your assistant about Entity body class

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
7
Tracked since
Feb 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 2
Maintenance
Dormant

Release Timeline

Releases

Version Type Core PHP Release date
2.0.3 Stable 8–11 Mar 3, 2025
2.0.2 Stable 8–11 Mar 3, 2025
2.0.1 Stable 8–10 Feb 16, 2024
2.0.0 Stable 8–10 Feb 16, 2024
2.0.x-dev Dev 8–11 Feb 16, 2024
1.0.0 Stable 8–10 Feb 16, 2024
1.0.x-dev Dev 8–10 Feb 16, 2024