Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
# custom_cookie_consent PT
<metal:macro define-macro="message">
<tal:block
define="ps context/@@plone_portal_state;
language ps/language;
root_url ps/navigation_root_url;
privacy_url_it string:${root_url}/it/privacy;
privacy_url_en string:${root_url}/en/privacy;"
condition="ps/anonymous">
<div class="cookielaw-wrapper">
<div style="display:none!important"
id="cookie-msg-it"
tal:condition="python: language == 'it'">
<p>
Questo sito utilizza solo cookie tecnici e di analytics, propri e di terze parti, per il corretto funzionamento delle pagine web e per il miglioramento dei servizi. Se vuoi saperne di più o negare il consenso consulta
<a tal:attributes="href privacy_url_it">l'informativa sulla privacy</a>.
Cliccando su "Ok" acconsenti all'uso dei cookie.
</p>
</div>
<div style="display:none!important"
id="cookie-msg-en"
tal:condition="python: language == 'en'">
<p>
This site uses cookies only technical and analytics, own and of third parties, for the proper functioning of the web pages and for the improvement of services. If you want to know more or withhold consent consult the
<a tal:attributes="href privacy_url_en">privacy policy</a>.
By clicking on "Ok" you consent to the use of cookies.
</p>
</div>
<!-- set language var -->
<script tal:content="string: var cookie_language = '${language}'" />
<script>
// default options
var cookie_options = {
'theme': 'dark-bottom',
'link': '',
'learnMore': '',
'dismiss': 'Ok!',
'message': $('#cookie-msg-' + cookie_language).html()
}
window.cookieconsent_options = cookie_options;
</script>
<script src="//s3.amazonaws.com/cc.silktide.com/cookieconsent.latest.min.js"></script>
</div>
</tal:block>
</metal:macro>
# main template inclusion
<metal:cookie use-macro="context/custom_cookie_consent/macros/message" />
# if you are using diazo
<append css:content=".cookielaw-wrapper" css:theme="body" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment