Translate Freemarker to LiQL query?
- 7 years ago
If the page is associated with a user, then "context.user" returns a user context object, otherwise returns null.
${page.context.user.id}
You can chain calls on the user object from this method. We can use this in MyProfilePage (only when an admin is editing another user's profile.) and ViewProfilePage on viewign other's profile information.
<#assign page_user_id = page.context.user.id />
<#assign custom-profile-field = profile.agent_id />
Using V1:
<#if page_user_id??>
<#assign allowed=rest("/users/id/${page_user_id?c}/profiles/name/${custom-profile-field}/allowed").value />
<#if allowed?trim == "true">
<#assign value = rest("/users/id/${page_user_id}/profiles/name/${custom-profile-field}").value />
<span>${value?string}</span>
</#if>
</#if>
Using V2:
Select * from users where id='${page_user_id?c}'