simple cookie consent code (#799)

* simple cookie consent code
This commit is contained in:
Markos Gogoulos 2023-06-12 16:40:53 +03:00 committed by GitHub
parent cd8d0ea49a
commit ad633e6fdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 65 additions and 39 deletions

View File

@ -17,6 +17,7 @@
- [14. Add Google Analytics](#14-add-google-analytics) - [14. Add Google Analytics](#14-add-google-analytics)
- [15. Debugging email issues](#15-debugging-email-issues) - [15. Debugging email issues](#15-debugging-email-issues)
- [16. Frequently Asked Questions](#16-frequently-asked-questions) - [16. Frequently Asked Questions](#16-frequently-asked-questions)
- [17. Cookie consent code](#17-cookie-consent-code)
## 1. Welcome ## 1. Welcome
@ -728,3 +729,9 @@ In [3]: for media in Media.objects.filter(media_type='video', sprites=''):
``` ```
this will re-create the sprites for videos that the task failed. this will re-create the sprites for videos that the task failed.
## 17. Cookie consent code
On file `templates/components/header.html` you can find a simple cookie consent code. It is commented, so you have to remove the `{% comment %}` and `{% endcomment %}` lines in order to enable it. Or you can replace that part with your own code that handles cookie consent banners.
![Simple Cookie Consent](images/cookie_consent.png)

Binary file not shown.

After

Width:  |  Height:  |  Size: 580 KiB

View File

@ -1 +1,20 @@
<div id="app-header"></div> <div id="app-header"></div>
{% comment %}
Uncomment, or replace with your own cookie consent code.
<script src="https://cdn.websitepolicies.io/lib/cookieconsent/cookieconsent.min.js" defer></script>
<script>
window.addEventListener("load", function () {
window.wpcc.init({
border: "normal",
corners: "normal",
colors: { popup: { background: "#222222", text: "#ffffff", border: "#FF8000" }, button: { background: "#FF8000", text: "#000000" } },
position: "top-right",
content: { message: "Hi there, we are using cookies on this website. We don't use tracking or analytics here, just the essentials for the Website to work.\n", button: "Understood! Yum!", link: "Click here to learn more." },
});
});
</script>
{% endcomment %}