Reputation: 1
{Kentico 10} I want to display a URL based on an authenticated user's membership type/level. I have a custom table (MemberURL) that keys the MembershipGUID from the CMS_Membership table to the record in the MemberURL table.
I have a DataSource webpart pulling data from the custom table. -- works
I have a Universal Viewer With Custom Query that returns the data -- works The transformation on this viewer webpart:
<%# CurrentUser.FullName %> -- <%# CurrentUser.UserName %><br/>
<%# CurrentUser.Memberships.Count %>><br>
<%# Eval("MembershipGUID") %>
<%# Eval("Description") %>
<%# Eval("WebTixsURL") %>
<%# Eval("Children_Max") %>
<%# Eval("Guest_Max") %>
<%# Eval("Adult_Max") %>
---returns all the data expected ==> the first two rows from the CurrentUser object and the last six from the custom table.
I am trying to find a way to look at the Current Users' membership type (level in our parlance) and compare the GUID of that level/type with the MembershipGUID from the custom table to determine which URL should be displayed.
I can't seem to return any of the CurrentUser's Memberships data in the transformations I am trying to build.
Upvotes: 0
Views: 74
Reputation: 995
I would recommend creating a custom transformation method. And in the code of the method, using the current user context you can get the details about the user and execute the logic you want and return desired URL as the result.
Upvotes: 0