Forum Discussion
RobertT
7 years agoBoss
Unfortunately that's not a solution for us, we need the logic to run on that page as we're modifying analytics calls based and one of the conditions we're specifically picking up on is where a user is viewing their own profile/media gallery pages.
Without the context object we can't compare the user ID to validate the user is looking at their own media gallery content.
Sign in to react to this post
Parshant
7 years agoBoss
When you goto any media gallery page your URL will be "https😕/community.khoros.com/t5/media/gallerypage/user-id/34821".
You can get the user-id for the media gallery by below code:
<#assign urlList = http.request.url?split("/") />
<#assign user_id = "" />
<#list urlList as url_split>
<#if url_split_index gt 0 && urlList[url_split_index - 1] == "user-id">
<#assign user_id = url_split />
</#if>
</#list>
Above will give you the user-id of the gallery page you are viewing.
you can check the condition with current login user(user.id) with below code after that.
<#if user_id == user.id>
[your condition code here]
</#if>
Sign in to react to this post