GDPR cookie warning and modal
You can use Composer to install this application., (*1)
composer require ride/wba-gdprcookie
The module includes a script & styling for a cookie banner and a modal where the visitor can select his/her cookie preferences., (*2)
You need to include the following snippet in your base/index.tpl
.
Right underneath the content_body
block, (*3)
<!-- Adds the cookie template to your page --> {if isset($gdprTemplate)} {$gdprTemplate} {/if} <!-- End of cookie template snippet -->
Add the link to the settings on your page., (*4)
<a href="javascript:void(0)" class="js-lcc-settings-toggle">{'cookies.settings_title'|translate}</a>
In your parameters.json
you set the url to your cookie policy page.
This has to be done per language.
eg., (*5)
`cookies.policy_url.nl => 'https://your.policy.url', (*6)
cookies.policy_url.en
=> 'https://your.policy.url', (*7)
cookies.policy_url.fr
=> 'https://your.policy.url', (*8)
If there is only one language present you can just set, (*9)
cookies.policy_url
=> 'https://your.policy.url', (*10)
You don't want the modal to pop up on your policy page.
So in your parameters.json
add:
"cookies.ignored_paths": "/en/cookie-policy"
, (*11)
Always use the relative url., (*12)
If you want to add more ignored paths for let's say multisites, use the ignored paths as in the example below., (*13)
Cookie settings can be altered in parameters too:, (*14)
"cookies.cookie_key": "__cookie_consent", "cookies.cookie_value_analytics": "2", "cookies.cookie_value_marketing": "3", "cookies.cookie_value_both": "true", "cookies.cookie_value_none": "false", "cookies.cookie_expiration_days": "365", "cookies.gtm_event": "cookie_refresh", "cookies.ignored_paths.0": "", "cookies.ignored_paths.1": "", "cookies.custom_style": false
## UPDATING FROM 2.2.0 TO 2.3.0 Translations have changes in this update. If you overwrite some in your own project, be sure to check if they are up to date., (*15)