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).

Simple Klaro

269 sites Security covered Drupal 9–11
View on drupal.org

This module integrates the Klaro consent management software into your Drupal site, allowing you to easily configure its behavior through a simple configuration file. It automatically displays the consent manager on all pages and offers options for styling, customizable links to preferences, and integration with script execution control.

This module provides a simple implementation of the Open Source Consent Management Software Klaro.

Because Klaro is configured using a simple configuration file, this module provides only a field for modifying this configuration. It is useful to add Klaro to a project with a simple configuration module, because this allows to change the configuration without deploying a new version of the website.

The module is called Simple Klaro, because it does not offer a feature rich configuration UI and does not integrate with other modules. An alternative module with a more complex configuration UI and integrations with other modules is here.

How to install

The module uses the klaro library either by CDN or installed via composer. The recommended setup is to install via composer, but this requires some extra steps.

  1. Add the composer merge plugin with composer require wikimedia/composer-merge-plugin
  2. And then add the following to the site's extra section of composer.json:
    "merge-plugin": {
      "include": [
        "docroot/modules/contrib/simple_klaro/composer.libraries.json"
      ]
    }
    

How to use

After enabling this module the consent manager appears automatically on all pages. A permission is provided to bypass Klaro, that can be granted to selected roles.

The consent manager can be integrated with default styles, or without styles, which makes it easy to adapt it to the design of a website.

Also a block is provided with a link to open the consent settings dialog after the settings have been saved. The syntax of the link is <a href="#" id="klaro-preferences">Cookie preferences</a>. Any HTML element with the id klaro-preferences will open the dialog, so a custom button can easily be created.

When the settings of Klaro are changed, all caches are cleared and the changed settings are applied on all pages.

Using the settings the appearance, the applications, all texts, and translations can easily be configured. Translations are displayed based on the lang attribute of the html element. The execution of scripts on the website is by default controlled by changing the script type from text/plain to application/javascript, when the corresponding consent setting is toggled. Additionally, custom callback functions can be invoked. When consent is revoked, cookies can be deleted with regular expressions.

Screenshots

Below are some screenshots of different configurations with and without custom styling.

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
6
Tracked since
Nov 2024
Latest release
1 year ago
Releases (12 mo)
0 ▼ from 6
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
1.12.1 Stable 9–11 Jul 31, 2025
1.12.0 Stable 9–11 Jul 30, 2025
1.11.1 Stable 9–11 Jul 17, 2025
1.11.0 Stable 9–11 Jul 17, 2025
1.10.0 Stable 9–11 May 27, 2025
1.9.5 Stable 9–11 Nov 26, 2024