Hi,
Any recommended way to add a GDPR cookie acceptance popup plugin with kvision?
I tried to include this plugin, https://github.com/Wruczek/Bootstrap-Cookie-Alert
But didn't work for me, still figuring out how to load the javascript after the page load 🙂
r
Robert Jaros
03/27/2021, 1:24 PM
It works without problems if I add recommended markup to the
index.html
file:
Copy code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>KVision App</title>
<script type="text/javascript" src="main.bundle.js"></script>
<link rel="stylesheet" href="<https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.css>">
</head>
<body>
<div id="kvapp"></div>
<!-- START Bootstrap-Cookie-Alert -->
<div class="alert text-center cookiealert" role="alert">
<b>Do you like cookies?</b> 🍪 We use cookies to ensure you get the best experience on our website. <a href="<https://cookiesandyou.com/>" target="_blank">Learn more</a>
<button type="button" class="btn btn-primary btn-sm acceptcookies">
I agree
</button>
</div>
<!-- END Bootstrap-Cookie-Alert -->
<!-- Include cookiealert script -->
<script src="<https://cdn.jsdelivr.net/gh/Wruczek/Bootstrap-Cookie-Alert@gh-pages/cookiealert.js>"></script>
</body>
</html>
ah I didn't thought about adding it in index.html.. My bad, I was adding inside footer as kvision HTML containers..
Kumaran Masilamani
03/27/2021, 1:51 PM
so that I can internationalise the content.. I will worry about that later.. Cheers
r
Robert Jaros
03/27/2021, 2:20 PM
You can probably just inject internationalized text into cookiealert div from the KVision application using direct DOM access. The script just shows the div without processing is content.