Public
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Occasional Advisor

Displaying Badge Count

How do you call the metric for "a logged in user's badge count, as shown on the "userbadgespage"

 

http://community.lithium.com/t5/badges/userbadgespage/user-id/46046/page/1

 

My attempt at this is

 

<#-- User Badge Count Variable
<#assign badgeCount = rest("/users/login/${user.id?c}/profile/metric.net.badges").value />
-->

<a href="javascript&colon;void(0);">You have ${badgeCount!""}</a>
Learning Content Strategist
3 Replies 3
Highlighted
Honored Contributor

@ryandewitt - Try this V2 call - select user_badges from users where id = '47'

The size returned is your number of badges.

 

I hope this helps.


Varun : Weaving magic with Khoros!

Recent Ideas: Advanced Private Messages | Rewarding Module | Badges for Threads
Highlighted

Hi @VarunGrazitti ,

Is there a call that can give us a number of users with a certain number of badges.? For example we would like to find out how many users in the community have 16 or 5 badges for example.

Thanks!

 

Highlighted
Occasional Advisor

This is very interesting looking forward to the answer from Varun. 

This is what I got. 

If you can grab "badge_count" and then set a "low_badge" Boolean

<#if rest("/users/id/" + user.id + "/profiles/name/badge_count").value == "">
<#assign low_badge=false>
<#else>
<#assign low_badge=true>
</#if>

Basically, Sounds like a If statement would solve this.  

-ryandewitt

Learning Content Strategist

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Lithium customer? For direct assistance from our Support team, please visit the Support Forum.