Install

Works with Drupal: ^10 || ^11

Using Composer to manage Drupal site dependencies

Alternative installation files

Download tar.gz 10.85 KB
MD5: 63d6a6bd07e16fa11abb25cc833c4e9e
SHA-1: 8dab6f17365a6ce41e9e8d486ec23419312549b8
SHA-256: 4d9be69c308f93043c1d0975363c09688cd0a6437a9d6ad5b92aa1989e994731
Download zip 15.87 KB
MD5: 62ce268f796b7981c88a6a277b00fc46
SHA-1: 8565c7a79e189acec4a25d4a257d981c1dcbdda0
SHA-256: 2bb1cc91cc7988e3b1e483c1ed798bbfa30e4c0d2694e217d2f715f8188e8514

Release notes

Body Roles Classes 1.x — Release Notes

Overview

This release marks a major milestone for the Body Roles Classes module, bringing
a complete architectural overhaul aligned with modern Drupal development standards.
The module has been rewritten from the ground up, replacing the legacy procedural
approach with a clean object-oriented architecture fully compatible with Drupal 10
and Drupal 11.

What's New

Object-Oriented Architecture

The module has been migrated from a procedural `.module` file to a modern
Hook class (`src/Hook/BodyRolesClassesHooks.php`), following Drupal 11's
recommended approach for implementing hooks. This makes the codebase easier
to maintain, test, and extend.

Configuration System

Settings are now stored using Drupal's configuration system instead of
variables. A dedicated settings form (`Admin > Configuration > User Interface
> Body Roles Classes`) allows administrators to manage the module without
touching code. Configuration can be exported and tracked in version control
alongside your site's config splits.

New Service Layer

A dedicated `RoleClassGenerator` service handles all the logic for generating
role-based CSS classes on the body tag. This separation of concerns makes the
logic reusable and independently testable, and allows other modules to
integrate with or override the service via Drupal's service container.

Routing

The module now defines its own routing (`body_roles_classes.routing.yml`) giving site
administrators granular control over who can change module settings without
requiring full site administration access.

Composer Support

A `composer.json` file has been added, making the module fully compatible with
Composer-based Drupal workflows. You can now manage the module as a proper
Composer dependency alongside the rest of your project.

Automated Testing Pipeline

A `.gitlab-ci.yml` pipeline configuration has been added, enabling automated
testing on GitLab CI. This ensures code quality and compatibility are verified
on every commit, giving contributors and site builders confidence in the
module's stability.

Improved Documentation

The legacy `README.txt` has been replaced with a modern `README.md` following
Drupal.org documentation standards. A `CHANGELOG.md` has also been added to
track changes across releases in a clear, structured format.

Created by: dkmishra
Created on: 9 May 2026 at 09:02 UTC
Last updated: 9 May 2026 at 09:03 UTC
New features

Other releases