-
Notifications
You must be signed in to change notification settings - Fork 203
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mod_cookie_consent: implements cookie consent handling and settings (#…
…3184) * mod_cookie_consent: implements cookie consent handling and settings * Use figure/figcaption for placeholder * Add link to explanation page and nl texts * Use category 'other' * Run widgetManager of replace cookie content * Default reload - changes to admin page for consent text
- Loading branch information
Showing
23 changed files
with
1,491 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Cookie consent | ||
============== | ||
|
||
Wrap external content in such a way that it is only loaded if the user consented to the | ||
inclusion of the content (and subsequent cookies). | ||
|
||
The consent is one of: | ||
|
||
- `functional` this is always allowed | ||
- `stats` if consent for statistics tracking is given | ||
- `all` for any other kind of cookies | ||
|
||
For elements this defaults to `all`. This means that they are only rendered if all consent is given. | ||
|
||
How to use | ||
---------- | ||
|
||
Ensure that your base template has an all-include of `_html_head.tpl` and `_html_body.tpl`. | ||
|
||
Also, if you are using IFRAMEs, JS or CSS that sets non-functional cookies, check the changes below. | ||
|
||
HTML | ||
---- | ||
|
||
Media embedded via mod_oembed or mod_video_embed are automatically wrapped according | ||
to this method. | ||
|
||
<pre> | ||
<figure class="cookie-consent-preview do_cookie_consent mediaclass-..." data-cookie-consent="all"> | ||
<img src="..." alt="Media preview"> | ||
<figcaption>Please consent to cookies to display external content.</figcaption> | ||
<script type="text/x-cookie-consented"> | ||
{% filter escape %} | ||
<iframe width="560" height="315" src="https://www.youtube.com/embed/IdIb5RPabjw" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe> | ||
{% endfilter %} | ||
</script> | ||
</figure> | ||
</pre> | ||
|
||
If there is no script tag then the page is reloaded after cookies are accepted. | ||
|
||
|
||
IFRAME | ||
------ | ||
|
||
Use the `data-cookie-consent-src` attribute to define the `src` if the cookie consent has been | ||
given. | ||
|
||
<pre> | ||
<iframe width="560" height="315" data-cookie-consent-src="https://www.youtube.com/embed/...."></iframe> | ||
</pre> | ||
|
||
|
||
JAVASCRIPT | ||
---------- | ||
|
||
Use the special `type="text/x-cookie-consent"` and optionally the `data-cookie-consent="..."` attribute: | ||
|
||
<pre> | ||
<script type="text/x-cookie-consent" data-cookie-consent="stats" src="https://..."></script> | ||
</pre> | ||
|
||
|
||
CSS | ||
--- | ||
|
||
Use the special `type="text/x-cookie-consent"` and optionally the `data-cookie-consent="..."` attribute: | ||
|
||
<pre> | ||
<link type="text/x-cookie-consent" data-cookie-consent="stats" href="https://..."></script> | ||
</pre> |
Oops, something went wrong.