Forum Discussion

bhupen's avatar
bhupen
Advisor
10 years ago

Show Rank icon

Hi All,

 

I made a custom call for latest post but now I need to show rank icon infront of author name. Following is the snippet I have used for post:

<#assign messages = rest("2.0","/search?q=" + "SELECT * FROM messages WHERE author.id='${user.id}' ORDER BY post_time DESC LIMIT 5"?url) />
<#assign ranking= restadmin("/users/id/${author.id}/ranking")> /* rest call for rank*/
     <#list messages.data.items as recent >
     <#if recent?has_content>
        <p><a href="${recent.view_href}">${recent.subject}</a></p>
        <p>${ranking.left_image}</p>
        </#if>
     </#list>

 

Following is the example for rank icon:

rank.PNG

Above code is working fine for post, only rank icon need to display.

 

 

 

  • VarunGrazittithanks for your assitence over this discussion also your suggestion helped me as well. Following is the snippet which works perfectly as per my requirement.

     

    <#assign messages = rest("2.0","/search?q=" + "SELECT * FROM messages WHERE author.id='${user.id}' ORDER BY post_time DESC LIMIT 5"?url) />
         <#list messages.data.items as recent >
         <#assign ranking= restadmin("/users/id/${recent.author.id}/ranking/display/left_image/url").value >
         <#if recent?has_content>
            <p><a href="${recent.view_href}">${recent.subject}</a></p>
            <p><img src="${ranking}" /> ${recent.author.login}</p>
            </#if>
         </#list>

    Note: Iam just putting it here for other help.

16 Replies