cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-251468%22%20slang%3D%22en-US%22%3EDisplaying%20Badge%20Count%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-251468%22%20slang%3D%22en-US%22%3E%3CP%3EHow%20do%20you%20call%20the%20metric%20for%20%22a%20logged%20in%20user's%20badge%20count%2C%20as%20shown%20on%20the%26nbsp%3B%22userbadgespage%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fbadges%2Fuserbadgespage%2Fuser-id%2F46046%2Fpage%2F1%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Ehttp%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fbadges%2Fuserbadgespage%2Fuser-id%2F46046%2Fpage%2F1%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20attempt%20at%20this%20is%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%26lt%3B%23--%20User%20Badge%20Count%20Variable%0A%26lt%3B%23assign%20badgeCount%20%3D%20rest(%22%2Fusers%2Flogin%2F%24%7Buser.id%3Fc%7D%2Fprofile%2Fmetric.net.badges%22).value%20%2F%26gt%3B%0A--%26gt%3B%3CBR%20%2F%3E%3CBR%20%2F%3E%20%26lt%3Ba%20href%3D%22javascript%26amp%3Bcolon%3Bvoid(0)%3B%22%26gt%3BYou%20have%20%24%7BbadgeCount!%22%22%7D%26lt%3B%2Fa%26gt%3B%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-252290%22%20slang%3D%22en-US%22%3ERe%3A%20Displaying%20Badge%20Count%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-252290%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fcommunity.lithium.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F46046%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3E%40ryandewitt%3C%2FA%3E%26nbsp%3B-%20Try%20this%20V2%20call%20-%26nbsp%3B%3CSTRONG%3Eselect%20user_badges%20from%20users%20where%20id%20%3D%20'47'%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3EThe%20%3CSTRONG%3Esize%3C%2FSTRONG%3E%20returned%20is%20your%20number%20of%20badges.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20this%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E
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>
Community Manager +
Learning Media/Content Producer
2 Replies 2
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!