A Neos CMS Package, that adds Cookie Consent to your Neos-Site
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Configuration
Resources
LICENSE
README.md
composer.json

README.md

KaufmannDigital.CookieConsent

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

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 can use this snippet in your Settings.yaml`:

KaufmannDigital:
  CookieConsent:
    policyPageNode: 'c7a91aa8-fbac-4c24-8326-102eb7307180' #Identifier of documentNode you want to link.

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
    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