Install
Works with Drupal: ^10 || ^11Using Composer to manage Drupal site dependencies
Alternative installation files
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.