This project is not covered by Drupal’s security advisory policy.
Adds enabled theme namespaces to the "containers.themespaces" parameter and a "themespace.namespaces" service to the dependency injection container. This allows themes to define classes and have discoverable class attributes plugins.
Theme namespaces are added to PSR4 and the class loader by the
Drupal\Core\Extension\ThemeHandler::addTheme() method. This module adds the ability to traverse namespaces of enabled themes in order to allow plugin
attribute discovery in themes.
The module also provides ProviderTypedPlugindDefinitions and attributes to
ensure that theme plugins and module provided plugins are identified and that plugin managers are able to handle them separately. Theme plugins in general should only be available when the providing theme is the active theme or from a base theme of the active theme.
Module does not add any functionality on its own and only provides utility for
module and theme developers to use OOP techniques in themes or to create new plugin APIs that support plugin discovery with themes.
See the Provider Typed Plugins section of the README.md file for more information about using plugin definitions and discovery classes in themes and modules.
Warning: Version 3 corrects issues the incorrect naming convention for theme namespaces, and by doing so can cause breaking changes if you use the previously suggested theme namespace convention (\Drupal\Theme\<theme name>).
Instead use \Drupal\<theme name> which will now match the Drupal namespace convention for modules and themes. Also instead of using container.namespaces for your plugin manager namespace traversable, replace this with the themespace.namespaces service in order to use provider typed plugin discovery.
Project information
- Project categories: Developer tools
5 sites report using this module
- Created by lemming on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
Releases
Drupal 11.3
Development version: 3.0.x-dev updated 12 Jan 2026 at 19:12 UTC