[ARCHIVED] Tip: How to add cool agent badges in Communities (Gather) | Community
Skip to main content

[ARCHIVED] Tip: How to add cool agent badges in Communities (Gather)

  • September 7, 2015
  • 58 replies
  • 0 views

Show first post

58 replies

Vladan
  • February 4, 2019

Hey Joel, your HC is not publicly visible: 

https://cl.ly/072838fde94c 

 


  • February 4, 2019

Hi Vladan,

I have managed to get this working, I needed to add in some sections to the Community_post_page.hbs also which I found on another thread below:

https://support.zendesk.com/hc/en-us/community/posts/360000552248-Adding-agent-badge-in-Communities

Final result (I moved myself into the moderator group, not the manager group to test):

 

Thanks for all of the help, it would never have worked without the areas you pointed out working too!

Kind regards,

Joel


Vladan
  • February 4, 2019

Glad to hear that, Joel! Thanks for keeping me posted!


  • February 5, 2020

Thank you for the article and the updates to Copenhagen.   

Can we use IDs instead of hardcoded names?  I'm concerned if two people posting with the same name as one of the moderators, the non-moderator user will also be branded, "Community Moderator" next to their name.  Can we use unique IDs?  If so, where can I find the IDs of our agents?

var moderators = ["Melanie Benzel", "Katrina Lewison", "Amy Frank", "Ryan Strait"

Any code examples would be much appreciated - Thank you.


  • February 5, 2020

@Katie Ginsburg Did you ever get an answer to using email address vs names?  They would work better for my scenario as well.


Brett13
  • Community Manager
  • February 5, 2020

Hey Ellen,

I wasn't able to track down any code that would use the agent ID instead, however, if you do figure out a way to code that, you can find the agent ID when viewing the agent's profile in Support.

The ID can be found in the URL when viewing the agent's profile. Otherwise, you can use the Support API to pull a list of users by role.

I hope this points you in the right direction!


Oleg13
  • October 9, 2020

Hey @Ellen and anyone else interested in this.

If you wish to use IDs instead of strings, here is something that I use to extract the IDs:

$('.comment-author').each(function(index) {
userId = parseInt($(this).children(".comment-meta").children("span[title]").children("a").attr("href").replace(/[^0-9]/g,''))

if ($.inArray(userId, developers) > -1) {

$(this).addClass('developer');

}

This way you can compose your array with IDs.

Hope this helps.


Nicole17
  • October 9, 2020

Thanks for sharing that, Oleg!

Also, I see that this is your first comment. Welcome to the Zendesk Community!