yurikleban
9 years agoMentor
Target a user's role via freemarker
Hey folks,
Wanted to see if anyone ever implemented something similar:
We learned how to target anonymous users with the following syntax:
<#if user.anonymous == true> User is anonymous. Display anonymous message here. <#else> User is authenticated. Display authenticted message here. You <em>can</em> <u>also</u> <strong>use</strong> HTML! </#if>
However, I was wondering if someone could share the syntax to target multiple user roles, e.g.:
<#if user.role == Admin | Author | LithiumAuthor> User has a role of admin or author or lithiumauthor and thus should see this <#else> if they do not have that role, they should see this </#if>
Thanks for any insights,
Y