This module provides a framework for organizing and managing entity type and bundle specific classes, offering a cleaner alternative to preprocess functions for custom theming and logic. It encourages developers to implement bundle classes within their own custom modules rather than installing this contributed one directly.
Bundle classes are regarded by some as the most underrated Drupal inclusion in recent times. You can read more about them at Introducing bundle classes (change record).
This module has two uses:
In your project
Don't actually install this module.
- Create your own custom module named
bundle_classes - Never worry about it conflicting with a contributed module
- Always find your bundle classes in the same place across projects
As a learning tool
At the moment this module has one demonstration capability:
- Use composer to include this module and its dependency in a fresh Drupal project
- Enable the module and the included demonstration theme
- Create an Article node, then edit it
- Watch the "Last updated" markup change with each edit
Prior to bundle classes this behaviour would typically have been achieved using a preprocess function. Note that there are no global functions in this module.
We aim to add more examples over time. MRs welcome!
Ask your assistant about Bundle Classes
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
Release Timeline
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.0-alpha2 | Pre-release | 10–11 | Jun 17, 2026 | ||
| 1.0.0-alpha1 | Pre-release | 10–11 | Aug 29, 2024 | ||
| 1.x-dev | Dev | 10–11 | Aug 29, 2024 |