Download the PHP package quentincharrier/cookie-consent-bundle without Composer
On this page you can find all versions of the php package quentincharrier/cookie-consent-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download quentincharrier/cookie-consent-bundle
More information about quentincharrier/cookie-consent-bundle
Files in quentincharrier/cookie-consent-bundle
Package cookie-consent-bundle
Short Description Sylius bundle for implementing Cookie Consent to comply to AVG/GDPR.
License MIT
Informations about the package cookie-consent-bundle
Cookie Consent bundle for Sylius
Sylius bundle to append Cookie Consent to your website to comply to AVG/GDPR for cookies.
Installation
Step 1: Download using composer
In a Sylius application run this command to install and integrate Cookie Consent bundle in your application:
Step 2: Enable the bundle
When not using symfony flex, enable the bundle in the kernel manually:
Step 3: Enable the routing
When not using symfony flex, enable the bundles routing manually:
Step 4: Configure to your needs
Configure your Cookie Consent with the following possible settings
Step 5: Add cookie policy path
Configure the path to your cookie policy page
Step 5: Add cookie policy path
Configure the path to your cookie policy page
Usage
Twig implementation
Load the cookie consent in Twig via render_esi ( to prevent caching ) at any place you like:
-
Template : Render the consent modal with the form to select the cookie category allowed or not
- Template : Render the notification banner if the cookie isn't allready set.
If you want to load the cookie consent with a specific locale you can pass the locale as a parameter:
Cookies
When a user submits the form the preferences are saved as cookies. The cookies have a lifetime of 1 year. The following cookies are saved:
- Cookie_Consent: date of submit
- Cookie_Consent_Key: Generated key as identifier to the submitted Cookie Consent of the user
- CookieCategory[CATEGORY]: selected value of user (true or false)
Logging
AVG/GDPR requires all given cookie preferences of users to be explainable by the webmasters. For this we log all cookie preferences to the database. IP addresses are anonymized. This option can be disabled in the config.
Themes
TwigExtension
The following TwigExtension functions are available:
chcookieconsent_isCategoryAllowedByUser check if user has given it's permission for certain cookie categories
chcookieconsent_isCookieConsentSavedByUser check if user has saved any cookie preferences
Customization
Categories
You can add or remove any category by changing the config and making sure there are translations available for these categories.
Translations
All texts can be altered via Symfony translations by overwriting the CHCookieConsentBundle translation files.
Styling
CHCookieConsentBundle comes with a default styling. A sass file is available in Resources/assets/css/cookie_consent.scss and a build css file is available in Resources/public/css/cookie_consent.css. Colors can easily be adjusted by setting the variables available in the sass file.
To install these assets run:
To install theme assets run:
And include the styling in your template:
Javascript
By loading Resources/public/js/cookie_consent.js the cookie consent will be submitted via ajax and the cookie consent will be shown on top of your website while pushing down the rest of the website.
Template Themes
You can override the templates by placing templates inside your poject:
All versions of cookie-consent-bundle with dependencies
doctrine/annotations Version ^1.6
doctrine/doctrine-bundle Version ^1.10 || ^2.0
doctrine/orm Version ^2.5
symfony/asset Version ^3.4 || ^4.2 || ^5.0
symfony/dependency-injection Version ^3.4 || ^4.2 || ^5.0
symfony/doctrine-bridge Version ^3.4 || ^4.2 || ^5.0
symfony/expression-language Version ^3.4 || ^4.2 || ^5.0
symfony/form Version ^3.4 || ^4.2 || ^5.0
symfony/framework-bundle Version ^3.4 || ^4.2 || ^5.0
symfony/http-foundation Version ^3.4 || ^4.2 || ^5.0
symfony/templating Version ^3.4 || ^4.2 || ^5.0
symfony/translation Version ^3.4 || ^4.2 || ^5.0
symfony/twig-bridge Version ^3.4 || ^4.2 || ^5.0
symfony/twig-bundle Version ^3.4 || ^4.2 || ^5.0
twig/twig Version ^2.6 || ^3.0