Forum Discussion

bartgoris's avatar
8 years ago

Topic page - user badges

Hi,   Does someone know how i can get recently earned badges / user on the topic page?   Kind regards, Bart
  • bartgoris's avatar
    bartgoris
    8 years ago

    Hi Payal,

     

    Thank you for the quick reply.


    I tried the following, but it gives me an empty result:

    <#assign topicBadges=rest("/users/id/279/badges?user_badges.sort_order=earned_date_desc").users />

    <#list topicBadges.user_badges as topicBadge>
    ${topicBadge.badge.icon_url}
    </#list>

     

    Do you know what I did wrong?

     

    Kind regards,

    Bart

  • Payal's avatar
    Payal
    8 years ago
    Hi bartgoris,

    I have made some changes to your code. Please try the following code and let me know if this works for you.

    <#assign topicBadges = rest("/users/id/279/badges?user_badges.sort_order=earned_date_desc").user_badges />
    <#list topicBadges.user_badge as topicBadge>
    ${topicBadge.badge.icon_url}
    </#list>

    Hope this helps!!

    Thanks,
    Payal