#3671 - Cookie Consent Update
| Identifier | #3671 |
|---|---|
| Issue type | Trivial issue (does not break functionality) |
| Title | Cookie Consent Update |
| Status | Completed |
| Tags |
Roadmap: v11 (custom) Type: External dependency (custom) |
| Handling member | Chris Graham |
| Addon | core_addon_management |
| Description | The Cookie Consent JS script we use has been revised.
I seem to have it working fine with the following code. {$,Cookie Consent plugin by Silktide - http://silktide.com/cookieconsent} {+START,IF,{$AND,{$CONFIG_OPTION,cookie_notice},{$RUNNING_SCRIPT,index}}} <link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.css" /> <script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.1.0/cookieconsent.min.js"></script> <script> window.addEventListener("load", function(){window.cookieconsent.initialise({"palette": {"popup": {"background": "#000"},"button": {"background": "#FFF"}},"theme": "block","position": "top","static": true,"content": {"message": "{!COOKIE_NOTICE;/,{$SITE_NAME}}","dismiss": "{!INPUTSYSTEM_OK;}","link": "{!READ_MORE;}","href": "{$PAGE_LINK;/,:privacy}"}})}); </script> {+END} Some new options in the new version to only show the notice in countries which require it (which might tie in with Composr regionalisation somehow and allow this to default to being active). |
| Steps to reproduce | |
| Funded? | No |
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".
Comments
1: https://github.com/ocproducts/composr/commit/873da9e13631d8b4a34f70eb42efc38dc74c14d3
If they require an ISO code to be passed, we can detect that using our get_country() function (which uses a combination of methods, ultimately IP_Country.txt).
Discuss with me in IRC if you like.
https://cookieconsent.osano.com/
This is the location demo @ https://cookieconsent.osano.com/examples/example-6-location.html
Thanks for the heads up @Adam, updated.
1: https://github.com/ocproducts/composr/commit/05f21166b13a14eadd1fe3d3df8a4e6eaa2f06a2
https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js
Might be a better CDN to use as it always links to the latest version.
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"> is the example, not sure how important the data-cfasync is but thought I would mention that too.
I have just added a new coding standard which I think is important:
"Unless intrinsically necessary for a particular piece of functionality, do not rely on external URLs such as CDNs. External URLs create a number of problems, including: network firewalls operating with whitelists blocking functionality (e.g. in museums), erratic firewall blocking (e.g. in China), full functionality not being available offline (e.g. when developing on an airplane), or full functionality not working in private offline Intranets (e.g. in schools). If users want to make use of CDNs they can make manual changes to achieve it."
It might be we need to remote link, but I doubt it.
I realise v10 is remote linking, so this is a change.