balazscsaba2006/cookiebot 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

balazscsaba2006/cookiebot

最新稳定版本:2.1.2

Composer 安装命令:

composer require balazscsaba2006/cookiebot

包简介

CookieBot integration into Craft CMS 3.

README 文档

README

CookieBot integration into Craft CMS 3 or 4.

Requirements

This plugin requires Craft CMS 3.0.0 or later.

Install

  • Install with Composer via: composer require balazscsaba2006/cookiebot
  • Navigate to Settings -> Plugins and click the "Install" button

Configure

  • Navigate to Settings -> Plugins and configure settings for Cookiebot

Overriding plugin settings

If you create a config file in your config/ folder called cookiebot.php, you can override the plugin’s settings in the Control Panel. Since that config file is fully multi-environment aware, this is a handy way to have different settings across multiple environments.

Here’s what that config file might look like along with a list of all of the possible values you can override.

    <?php

    return [
        'domainGroupID' => 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
        'defaultPreferences' => true,
        'defaultStatistics' => true,
        'defaultMarketing' => false
    ];

Usage

Can be used to render dialog and declaration script on Twig templates

Render dialog script:

{{ craft.cookiebot.dialogScript()|raw }}

Render declaration script:

{{ craft.cookiebot.declarationScript()|raw }}

Render dialog/declaration script in a certain language:

{# dialog script #}
{{ craft.cookiebot.dialogScript(craft.app.locale.id)|raw }}

{# declaration script #}
{{ craft.cookiebot.declarationScript(craft.app.locale.id)|raw }}

Can be used to check for consent on certain cookie categories like: Preferences, Statistics and Marketing.

Checking for any consent:

{% if craft.cookiebot.hasConsent %}
    {# ... #}
{% endif %}

Checking for consent on a specific category:

Preferences:

{% if craft.cookiebot.hasPreferencesConsent %}
    {# ... #}
{% endif %}

Statistics:

{% if craft.cookiebot.hasStatisticsConsent %}
    {# ... #}
{% endif %}

Marketing:

{% if craft.cookiebot.hasMarketingConsent %}
    {# ... #}
{% endif %}

统计信息

  • 总下载量: 11.3k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2018-06-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固