Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

EU Cookies plugin - old instructions on GitHub?

Started by Muut Archive 9 years ago · 2 replies · 1386 views
9 years ago

I have tried both CookiesNotice v1.0.2 and CookiesPolicy v1.0.10 and I am not the right guy for this coding stuff apparently :-)
Live website with a Helium skeleton + Gantry, and everything updated, and a minimum of plugins.

I have put the code below in the Gantry5 "Base Outline - Page Setting - Body Attributes - Before </body>"

TWIG
{{ cookiesnotice_markup }}

but the only thing I see is like in this picture.
Error cookiespolicy_markup
Maybe I can't write markup directly in to Gantry - I don't know - but how should I write it. Div's don't work either?

The documentation (README.md) say :

To run the script on your site, just call the variable {{ cookiesnotice_markup }} in template before the body close tag. E.g. in /your/site/grav/user/themes/themename/templates/partials/base.html.twi g
It almost the same instructions in both of the cookie-plugin's - But I don't have the template or partials folders and I don't have the files in the Helium skeleton.

Is it a bug or - more likely - am I missing something here ?

Regards
Torbjörn

9 years ago

Was interested in this for future projects so decided to put a clean install of grav / gantry and I couldn't even get the error message working (not too sure how to insert the code to call in gantry apart from the {{ cookie_markup }} inside the before body section..

so kinda of gave up .. then did a bit of googling and here is a solution that is tested and working . Done by inspiretheme and

https://www.inspiretheme.com/blog/freebies/99-cookie-consent-atom-for-gantry-5-freebie
https://cookieconsent.insites.com/

its fully customisable https://cookieconsent.insites.com/download/

It uses a cdn which does all the hardwork just add to the head section

<link rel="stylesheet" type="text/css" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
}
}
})});
</script>

Hope that helps

9 years ago

Thanks, Devouk

Hope that helps
Yeah, that was exactly what I needed.
It works like a charm and now I have installed it on all GRAV-sites.

Have earlier used some InspireTheme particles and atoms on Gantry 5 themes from RocketTheme - and they are also doing the job !!

Thanks again for pointing me in right direction :-)
Regards
Torbjörn

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1280 9 years ago
Archive · by Muut Archive, 9 years ago
2 888 9 years ago
Archive · by Muut Archive, 9 years ago
2 4017 9 years ago
Archive · by Muut Archive, 9 years ago
1 2892 9 years ago
Archive · by Muut Archive, 9 years ago
3 1077 9 years ago