hofff/contao-consent-bridge

Contao与第三方扩展之间的同意工具桥接

资助包维护!
dmolineus

安装次数: 4,689

依赖者: 7

建议者: 0

安全: 0

星标: 2

关注者: 3

分支: 1

公开问题: 0

类型:contao-bundle

1.5.0 2024-02-07 10:44 UTC

This package is auto-updated.

Last update: 2024-09-07 11:58:52 UTC


README

此扩展提供将同意工具集成到Contao的桥接。

它适用于在客户端处理同意管理但可能需要修改HTML输出的同意工具。

要求

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

安装

您可以使用Composer/Contao Manager安装 hofff/contao-consent-bridge

变更日志

查看 变更日志

特性

  • 在根页面提供同意工具的激活
  • 为内容元素分配所需的同意ID,并调整输出以满足同意工具的要求
  • 为前端模块分配所需的同意ID,并调整输出以满足同意工具的要求
  • 提供接口,以便可以调整特定前端模板的渲染以满足同意工具的要求
  • 内置对页面布局中定义的Google Web字体支持
  • 提供插件基础设施,以便支持扩展
  • 提供同意工具的接口

集成

作为扩展开发者

如果您提供包含可能需要同意才能渲染的自定义内容元素或前端模块的扩展,您可以注册一个提供额外信息的插件。您需要将其标记为 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());
    }
}

然后,将会有一个新的图例,您可以在其中将同意ID分配给您的配置,并且HTML输出的渲染将根据同意工具的要求自动调整。

作为同意工具开发者

作为同意工具开发者,您需要实现接口 Hofff\Contao\Consent\Bridge\ConsentTool 并将其标记为 hofff_contao_consent_bridge.consent_tool 在依赖注入容器中。