Developer forum

Forum » Templates » Global:CookieOptInLevel

Global:CookieOptInLevel

Martin Kure
Reply

Hi, 

I'm trying to set a cookie warning using the standard cookiewarningSEOsafe.html. 

However I'm only using the acceptAll button and not divide it into functional and tracking cookies. 

This part works fine. 

But in my template i'm not only using dynamicweb cookies, but also google maps etc, which also sets cookies. I wanna wrap these other code-pieces inside conditionals and only show them, after people have accepted cookies. I'm using the @Global:CookieOptInLevel to detect, if people have accepted the cookies.

<!--@If(Global:CookieOptInLevel == 2)-->

 display content

<!--@EndIf-->

But I can't seem to get a true from the conditional. I have even triede with "functional" and "All", but it's never true - even when the cookie is set.

 

Can you please help me out.

Regards

 

Martin

 


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

What is the version you run on?

This should work:

<!--@If(Global:CookieOptInLevel='All')-->

 display content

<!--@EndIf-->
Votes for this answer: 1
 
Martin Kure
Reply

I run 8.5.

Ok, so you only need on "=" for comparison.

It works.

Thanks.

Regards.

Martin

 

You must be logged in to post in the forum