Bridge between consent tools and third party extensions for Contao

Fund package maintenance!

Installs: 4 478

Dependents: 6

Suggesters: 0

Security: 0

Stars: 2

Watchers: 3

Forks: 1

Open Issues: 0


1.5.0 2024-02-07 10:44 UTC

This package is auto-updated.

Last update: 2024-06-07 11:28:25 UTC


This extension provides a bridge for integrating consent tools into Contao.

It's designed for consent tools which handles consent management on the client side but may require modified html output.


  • Contao ^4.9
  • PHP ^7.1 || ^8.0


You can install hofff/contao-consent-bridge using Composer/Contao Manager.


See changelog


  • Provides activation for consent tools in root page
  • Assign required consent ids for content elements and adjust output to fullfill requirements of consent tool
  • Assign required consent ids for frontend modules and adjust output to fullfill requirements of consent tool
  • Provides interface so that rendering for specific frontend templates can be adjusted to fullfill requirements of consent tools
  • Built in support to google webfonts defined in the page layout
  • Provides plugin infrastructure for extensions so that they are supported
  • Provides interface for consent tools


As extension developer

If you provide an extension with custom content elements or frontend modules which might require consent to be rendered you can register a plugin which provides extra information. You need to tag it as hofff_contao_consent_bridge.plugin.

namespace Your\Bundle;

use Hofff\Contao\Consent\Bridge\Bridge;
use Hofff\Contao\Consent\Bridge\Bridge\Plugin;
use Hofff\Contao\Consent\Bridge\Render\RenderInformation;

class MyPlugin implements \Hofff\Contao\Consent\Bridge\Plugin
    public function load(Bridge $bridge): void
        $bridge->supportFrontendModule('custom_1', RenderInformation::autoRenderWithoutPlaceholder());
        $bridge->supportFrontendModule('custom_2', RenderInformation::autoRenderWithPlaceholder('custom_placeholder_template'));
        $bridge->supportFrontendModule('custom_3', RenderInformation::customRender());

        $bridge->supportContentElement('custom_1', RenderInformation::autoRenderWithoutPlaceholder());
        $bridge->supportContentElement('custom_2', RenderInformation::autoRenderWithPlaceholder('custom_placeholder_template'));
        $bridge->supportContentElement('custom_3', RenderInformation::customRender());

Then there will be a new legend where you can assign a consent id to your configuration and the rendering of the html output will automatically adjusted depending the requirements of the consent tool.

As consent tool developer

As consent tool developer you need to implement the interface Hofff\Contao\Consent\Bridge\ConsentTool and tag it as hofff_contao_consent_bridge.consent_tool in the dependency injection container.s