Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Usage Milestone: Simplify Module simplify crossed 10,000 active installs. Usage Milestone: Views Reference Filter Module entityreference_filter crossed 10,000 active installs. Usage Milestone: Dropdown Language Module dropdown_language crossed 10,000 active installs. Usage Milestone: Paragraphs Browser Module paragraphs_browser crossed 10,000 active installs. Usage Milestone: OpenAPI Module openapi crossed 10,000 active installs. Usage Milestone: Decoupled Router Module decoupled_router crossed 10,000 active installs. Usage Milestone: Time Field for Drupal 8+ Module time_field crossed 10,000 active installs. Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Themespace

4 sites Security covered Drupal 11 · not 10
View on drupal.org

This module enables themes to define their own namespaces, allowing for better organization and discovery of theme-specific classes and plugins. It provides utility for developers to use object-oriented programming in themes and build plugin systems that can discover and manage theme-provided plugins separately from module plugins.

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.

Modules that depend on Themespace

  • Transmuter (https://drupal.org/project/transmuter)

    Module provides theme preprocessor a discoverable plugins. Allows theme attribute discovery of plugins.

    This module is also a demonstration of using theme namespaces for plugin discovery and only being applied for the active theme.

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
9
Tracked since
Nov 2024
Latest release
1 month ago
Releases (12 mo)
5 ▲ from 4
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
4.0.0 Stable 11 Jul 30, 2026
3.0.0-beta4 Pre-release 10–11 Jul 30, 2026
4.0.x-dev Dev 11 Jul 22, 2026
3.0.0-beta3 Pre-release 10–11 Jan 12, 2026
3.0.0-beta2 Pre-release 10–11 Jan 5, 2026
3.0.0-beta1 Pre-release 10–11 Mar 6, 2025
3.0.x-dev Dev 10–11 Mar 6, 2025
2.0.x-dev Dev 10–11 Nov 17, 2024
2.0.0-beta1 Pre-release 10–11 Nov 17, 2024