Forum Discussion

jmurray's avatar
jmurray
Champion
12 years ago

trying to get usernames to be colored by rank color in a module

Hi,   So here's what I've got so far:   The problem with this^ is that my username is green.  It should be red, because I'm an admin.  Likewise, my Community Guides should be pink, etc.  ...
  • ChiaraS's avatar
    ChiaraS
    12 years ago

    Hi,

     

    note that you can also use rest to get the rank color for the user and freemarker to get the user's profile page url:

     

    <#assign rank_display = rest("/users/login/${user.login}/ranking").ranking />
    <#assign rank_color = rank_display.display.color />
    <#if rank_color != "">
    	<#assign rank_color = "style=\"color:#${rank_color}\"" />
    </#if>
    
    <a class="lia-link-navigation lia-page-link lia-user-name-link" ${rank_color} target="_self" href="${user.webUi.url}">
    	${user.login}
    </a>