Hi,
I want some "editabletext" content to only appear to website visitors if they have a specific cookie with a specific value saved in their browser.
That was pretty easy ... I just added a macro to the webpart's "visible" field to check that cookie. It works ALMOST perfectly:
{% if (DecryptString(Cookies["theCookie"]]) == "theCookieValue") {true} else {false} #%}
The one problem I'm having is that "visible" field also affects whether the content editors can see that "editabletext" editing area. If that cookie isn't set to the correct value, they can't access the editabletext item to edit the content!
Is there any way I can make that "editabletext" ALWAYS visible in kentico admin ... but only visible to website visitors if they have that specific cookie set?
thank you, Rita.
You need to check viewmode: {% if ((ViewMode == "LiveSite") &&(DecryptString(Cookies["theCookie"]]) == "theCookieValue")) {true} else {false} |(identity)GlobalAdministrator%}
{% if ((ViewMode == "LiveSite") &&(DecryptString(Cookies["theCookie"]]) == "theCookieValue")) {true} else {false} |(identity)GlobalAdministrator%}
Thank you!!!
Please, sign in to be able to submit a new answer.