Claudius
4 years agoBoss
Checking for user cookie consent
Wanted to share this Freemarker snippet for use in custom components which checks if a user gave consent to the Khoros Community popup for cookies.
<#assign cookieConsent = http.request.cookies.name.get("LithiumCookiesAccepted") />
<#if cookieConsent?? && cookieConsent.value?? && (cookieConsent.value == "true")>
<#-- Lithium/Khoros Cookies are accepted -->
</#if>
We are using this in our community to show a close button on announcement banners and only then set a cookie to hide the announcement banners until their content changes.