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). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Release: Change Requests 2.1.9 Minor update available for module change_requests (2.1.9). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

Preprocess

1,184 sites Security covered Drupal 9–11
View on drupal.org

This module provides a structured way to handle preprocessing in Drupal by introducing a plugin system. It allows you to define preprocessing logic in separate, reusable plugins instead of monolithic theme or module files, leading to cleaner, more object-oriented, and generic code.

This module provides a plugin type for preprocessing. The manager scans for implementations and executes the preprocessors when they meet the given `hook`
criteria. It is designed to make preprocessing more structural and more clearly for themers.

  • Provides a plugin type that you can use in your theme or module
  • Theme plugins are discovered through YML, by creating a MY_THEME.preprocessors.yml you can register them.

With this module you no longer have to write all your preprocessing in your THEME.theme or module file. You gain the possibility to focus preprocessing on specific elements without having to write so many conditional checks for one specific hook implementation to cover all cases.

Yes, this module will help you write more generic, structural and cleaner preprocessing.

Yes, you will gain the possibility to write Object-oriented preprocessing, providing more flexibility and better integration.

No, it does nothing out of the box, you will have to write your own implementations, just as you would with hook_preprocess_HOOK, for any preprocessing you like.

Installation

This module can be installed as any other Drupal module and needs no extra configuration.

Note that if you want to rely on this module in your theme the dependency can't be set explicitly until #474684: Allow themes to declare dependencies on modules is resolved. You will need to make sure the preprocess module is enabled manually.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

1 tracked project depends on this one

Activity

Tracked releases
4
Tracked since
Oct 2024
Latest release
1 month ago
Releases (12 mo)
3 ▲ from 1
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
2.2.3 Stable 9–11 Jul 7, 2026
2.2.2 Stable 9–11 Dec 24, 2025
2.2.1 Stable 9–11 Sep 11, 2025
2.2.0 Stable 9–11 Oct 9, 2024