Forum Discussion
RobertT - Yes, it is indeed really surprising why this isn't available OOTB. As a workaround, you could pass it on to the next page in the URL and then use it in your analytics. Just override the media gallery component and add a custom link to pass the username to the next page.
I hope this helps.
- RobertT6 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.
- Parshant6 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>
Related Content
- 5 months ago
- 11 months ago
- 2 years ago