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="...
  • bhupen's avatar
    10 years ago

    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.