Download the PHP package hofff/contao-consent-bridge without Composer
On this page you can find all versions of the php package hofff/contao-consent-bridge. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package contao-consent-bridge
Bridge between consent tools and third party extensions for Contao
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.
Requirements
- Contao
^4.9 - PHP
^7.1 || ^8.0
Installation
You can install hofff/contao-consent-bridge using Composer/Contao Manager.
Changelog
See changelog
Features
- 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
Integration
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.
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 adjust depending on 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. Use the
\Hofff\Contao\Consent\Bridge\WithGenericContextSupport interface if the consent tools should support twig.
Twig integration
The extension provides Twig filters and functions to use consent functionality directly in Twig templates.
The consent tool must implement \Hofff\Contao\Consent\Bridge\WithGenericContextSupport to support Twig rendering.
hofff_consent_required — Function
Checks whether consent is required for a given consent ID. Returns true if the active consent tool requires
consent, false otherwise (also when no consent tool is active or the ID is invalid).
hofff_consent_content — Filter
Wraps HTML content according to the requirements of the active consent tool. If consent is required, the output is transformed by the consent tool (e.g. replaced with a placeholder). An optional custom placeholder template and additional data can be passed.
If no consent tool is active or the consent ID is invalid, the original HTML is returned unchanged.
The filter can also be applied to larger blocks using the {% apply %} tag:
hofff_consent_raw — Filter
Applies consent requirements to raw HTML content (e.g. inline scripts or tracking code) without adding a visual placeholder. This is intended for hidden markup that should be managed by the consent tool but does not need a visible fallback.
If no consent tool is active or the consent ID is invalid, the original HTML is returned unchanged.
The filter can also be applied to blocks using the {% apply %} tag:
All versions of contao-consent-bridge with dependencies
ext-json Version *
ext-pdo Version *
contao-community-alliance/meta-palettes Version ^2.0
contao/core-bundle Version ^4.13 || ^5.3
doctrine/dbal Version ^3.9 || ^4.0
netzmacht/contao-toolkit Version ^3.9 || ^4.0
netzmacht/html Version ^2.0 || ^3.0
symfony/config Version ^5.4 || ^6.4 || ^7.4
symfony/dependency-injection Version ^5.4 || ^6.4 || ^7.4
symfony/event-dispatcher Version ^5.4 || ^6.4 || ^7.4
symfony/http-kernel Version ^5.4 || ^6.4 || ^7.4
symfony/translation-contracts Version ^1.0 || ^2.0 || ^3.0
twig/twig Version ^3.8