hofff / contao-consent-bridge
Bridge between consent tools and third party extensions for Contao
Fund package maintenance!
dmolineus
Installs: 4 956
Dependents: 7
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 1
Open Issues: 0
Type:contao-bundle
Requires
- php: ^8.1
- ext-json: *
- ext-pdo: *
- contao-community-alliance/meta-palettes: ^2.0
- contao/core-bundle: ^4.13 || ^5.0
- doctrine/dbal: ^3.4
- netzmacht/contao-toolkit: ^3.9 || ^4.0
- netzmacht/html: ^2.0 || ^3.0
- symfony/config: ^5.4 || ^6.4
- symfony/dependency-injection: ^5.4 || ^6.4
- symfony/http-kernel: ^5.4 || ^6.4
- symfony/translation-contracts: ^1.1 || ^2.0 || ^3.0
Requires (Dev)
- contao/manager-plugin: ^2.1
- doctrine/coding-standard: ^12.0
- friends-of-phpspec/phpspec-expect: ^4.0
- netzmacht/phpspec-phpcq-plugin: @dev
- phpcq/runner-bootstrap: ^1.0@dev
- phpspec/phpspec: ^7.4
README
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
.
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