CookieHelper in a macro?

Vic Carter asked on April 21, 2014 11:24

I am using this to do some localization of static text on some shared components in a couple of my sites. I need to apply this to a custom query.

CookieHelper.GetValue("CMSPreferredCulture")

I tried using:

{%CookieHelper.GetValue("CMSPreferredCulture")%}

in the WHERE condition, but it keeps coming up blank. Figuring I am missing a reference in the string. Any suggestions? This is what I am going for:

DocumentCulture = {%CookieHelper.GetValue("CMSPreferredCulture")%}

Thanks in advance.

Correct Answer

Vic Carter answered on April 21, 2014 11:53

My apologies. I have found the correct syntax:

DocumentCulture = '{@CMSPreferredCulture@}'

Hope this can help someone else.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Vic Carter answered on April 21, 2014 11:37

As a follow up, I am using a custom layout to do this on other webparts. The one in question didn't need this functionality for anything else so I am attempting to just use the WHERE condition setting. If all else fails I can just create a layout.

Just an FYI.

0 votesVote for this answer Mark as a Correct answer

lawrence whittemore answered on December 16, 2014 20:52

I am trying to do something similar but am not having any luck. I am version 8.1

0 votesVote for this answer Mark as a Correct answer

Jan Hermann answered on December 17, 2014 12:41 (last edited on December 10, 2019 02:30)

Hello,

Please use this one instead {% Cookies.GetValue("CMSPreferredCulture") |(identity)GlobalAdministrator%}.

Best regards,
Jan Hermann

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.