Hi, Any recommended way to add a GDPR cookie acce...
# kvision
k
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
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> &#x1F36A; 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>
I use the same plugin myself with my other KVision application: https://e-rezerwacje.finn.pl/mzdbielsko/
k
ah I didn't thought about adding it in index.html.. My bad, I was adding inside footer as kvision HTML containers..
so that I can internationalise the content.. I will worry about that later.. Cheers
r
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.
👍 1