Hi,
I am trying to build a documentation with GDPR compliant Youtube embeds. So I downloaded the Grav-RTFM Skeleton und since the Youtube Plugin did not work for me and did not really offer a two-click-solution with giving consent to youtube cookies either, I searched in the Internet and found this tutorial about privacy-friendly video embeds.
So for testing purposes I…
- copied the markup of the tutorial to a chapter-page
- copied the css of the tutorial to /user/themes/learn2/css/custom.css
- added a file ‘youtube-consent.js’ in /user/themes/learn2/js/ and copied the script under " Storing the user’s preference" in the linked tutorial in that file
- in /user/themes/learn2/templates/partials/base.html.twig I searched for
{% block javascript %}
and I added a line{% do assets.addJs('theme://js/youtube-consent.js', 99) %}
in that block. This is how I understood the Asset Manager.
The result is, I see the message with asking for consent for youtube cookies and it is nicely styled by the css. But when I click of the “Allow content …” button, the page reloads and everything stays the same - no video, but still the consent message.
I tested it on a local webserver and in the logs I can see a “GET /user/themes/learn2/js/youtube-consent.js”, so I guess, the code is executed, but somehow it does not work.
Am I doing something wrong? Does someone have a tip?