kaufmanndigital/cookieconsent 问题修复 & 功能扩展

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

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

kaufmanndigital/cookieconsent

Composer 安装命令:

composer require kaufmanndigital/cookieconsent

包简介

A ready-to-run Neos CMS Package, that adds Cookie Consent to your Neos-Site

README 文档

README

A ready-to-run package, that integrates Cookie Consent into your Neos CMS site.

We have created a new package with many more functions, inline maintenance and even easier configuration. 🎉
Have a look at KaufmannDigital.GDPR.CookieConsent.

Installation

The easiest way to install is via composer:

composer require kaufmanndigital/cookieconsent

Afterwards, you should see the Cookie Hint on your page.

To configure the policy-link, you have the following two options:

  • Add the NodeType-Mixin KaufmannDigital.CookieConsent:PolicyPageMixin to your Home-NodeType (if you have a specific NodeType for home):

      'Your.Package:Document.Home':
        superTypes:
          'Neos.Neos:Document': true
          'KaufmannDigital.CookieConsent:PolicyPageMixin': true
          ...

    After that, simply select the policy page in your Neos backend.

  • Or use this snippet in your Settings.yaml:

      KaufmannDigital:
        CookieConsent:
          #Global configuration of PolicyPage
          policyPageNode: 'c7a91aa8-fbac-4c24-8326-102eb7307180' #UUID of global page you want to link
    
          #Configuration per site for multisite installations
          #Replace site1/site2 with your sitename (/sites/sitename/node-a2ufd/.../)
          policyPageNodes:
            site1: 'c7a91aa8-fbac-4c24-8326-102eb7307180' #UUID of policy-page for /sites/site1
            site2: '454d85b6-289b-11e9-b210-d663bd873d93' #UUID of policy-page for /sites/site2

Congratulations, you added Cookie Consent to your Neos CMS page. That was easy, right?

Changing the text

The content inside Cookie Consent is managed via translations. If you want to change it, copy the Packages/Application/KaufmannDigital.CookieConsent/Resources/Private/Translations folder into your Site-Package and add this configuration to Settings.yaml:

KaufmannDigital:
  CookieConsent:
    translations:
      package: 'Vendor.Package'
      source: 'Main'

From now, the translation from your package (in this example "Vendor.Package") will be used.

Translations for German and English are provided by this package. We are happy to get translations for your language via Pull-Request.

Changing layout & colors

You can also change colors and position. To do so, you have to add this snippet to Settings.yaml:

KaufmannDigital:
  CookieConsent:
    position: 'bottom' # bottom, bottom-left, bottom-right, top, top-left or top-right
    theme: 'block' # block, classic, or edgeless
    layout: 'basic' # basic, basic-close or basic-header
    palette:
      popup:
        background: '#000' #like in css
        text: 'white' #like in css
      button:
        background: 'rgb(255, 0, 0)' #like in css
        text: '#fff' #like in css

You don't have to override all values. Just pick what you want to change. More configuration-options can be found at cookieconsent.insites.com

Using Opt-In or Opt-Out

In order to use Opt-In or Opt-Out functionality, you have to activate it in Settings:

KaufmannDigital:
  CookieConsent:
    type: 'opt-in' #Or 'opt-out' (depending on what you want to do)

Afterwards, you can listen to the kd-cookieconsent event in JavaScript to en-/disable cookies:

document.addEventListener("kd-cookieconsent", function (e) {
    if (e.detail === 'enable-cookies') {
        //Enable your cookies here
        //For Google Analytics:
        window['ga-disable-UA-<YOUR-SITE-CODE>'] = false;
    } else if (e.detail === 'disable-cookies') {
        //Disable your cookies here
        //For Google Analytics:
        window['ga-disable-UA-<YOUR-SITE-CODE>'] = true;
    }
});

Compile JS & CSS into your own files

If you don't want this Package to include it's own JS and CSS, you can disable it with in Settings.yaml:

KaufmannDigital:
  CookieConsent:
    includeJavaScript: false
    includeCss: false

If you do so, you have to include JS & CSS of Cookie Consent in your files. Instructions can be found here

FAQs

  • Cookie Consent isn't shown in Backend.
    • It's a feature, not a bug ;-)

Known Bugs

Known Bugs are submitted as issue. Please have a look at it, before you supply a bug you found. You did a bugfix? Great! Please submit it as PR to share it with other users.

Planned Features

Planned functions are also created as issues and marked as such. You have another idea? Or would you like to help with the implementation? Gladly! Simply create new issues or PRs.

Maintainer

This package is maintained by Kaufmann Digital. Feel free to send us your questions or requests to support@kaufmann.digital

License

Licensed under MIT, see LICENSE

kaufmanndigital/cookieconsent 适用场景与选型建议

kaufmanndigital/cookieconsent 是一款 基于 HTML 开发的 Composer 扩展包,目前已累计 13.85k 次下载、GitHub Stars 达 14, 最近一次更新时间为 2018 年 04 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 kaufmanndigital/cookieconsent 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 kaufmanndigital/cookieconsent 我们能提供哪些服务?
定制开发 / 二次开发

基于 kaufmanndigital/cookieconsent 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 2
  • Forks: 4
  • 开发语言: HTML

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-09