How to add a Verification badge next to an agents name

12 Comments

  • Cedric Jacob
    Comment actions Permalink

    Hey Nicholas,

    I can give you hand if you like.

    Can you send me the link to your Help Center?

    Cheers,

    Cedric

    0
  • Nicholas Mauro
    Comment actions Permalink

    Oh awesome! My help desk URL is https://shopnicholasmauro.zendesk.com

    0
  • Cedric Jacob
    Comment actions Permalink

    Cool, give me a few minutes. I will write a little tutorial for you. Or do you have a Sandbox I can work in?

    0
  • Nicholas Mauro
    Comment actions Permalink

    I dont have a Sandbox 

    0
  • Cedric Jacob
    Comment actions Permalink

    Please replace the JS code with the following:

    $(document).ready(function() {

    var moderators = ["Username 1", "Username 2", "Adam Pepper", "Another Person"];
    var supportManagers = ["Nicholas Mauro", "Christian Colding", "Jesper Petersson"];

    $('.comment-author').each(function(index) {

    if ($.inArray($(this).find(':nth-child(2)').find(':nth-child(1)').attr("title"), supportManagers) > -1) {
    $(this).addClass('support-manager');
    }
    else if ($.inArray($(this).find(':nth-child(2)').find(':nth-child(1)').attr("title"), moderators) > -1) {
    $(this).addClass('moderator');
    }

    });

    if ($.inArray($('.post-author').find(':nth-child(2)').find(':nth-child(1)').attr("title"), moderators) > -1) {

    $('.post-author').addClass('moderator');

    } else if ($.inArray($('.post-author').find(':nth-child(2)').find(':nth-child(1)').attr("title"), supportManagers) > -1) {

    $('.post-author').addClass('support-manager');
    }

    });

    Let me know when you replaced it and published your HC again. I will then review it there  and make adjustments. If it works, I will comment the code for you. 

    0
  • Cedric Jacob
    Comment actions Permalink

    Hey Nicholas,

    I reviewed this question again and I think there is a better solution,

    I just wrote a blog-post about it here:

    http://www.cedricfjacob.com/viewpost.php?post=zendesk-help-center-how-to-add-badges-to-your-agents 

    Cheers,

    Cedric

    0
  • Nicholas Mauro
    Comment actions Permalink

    Thank you so much for all of your help! I'll try this tonight and let you know! 😃

    0
  • Cedric Jacob
    Comment actions Permalink

    Cool, please let me know if I can help with the code or if it worked for you. I would love to try my new solution with another Help Center.

    Cheers,

    C

    0
  • Brian Scavullo
    Comment actions Permalink

    Unfortunately, this isn't working for me.
    Any chance someone can help me out with this?
    Thanks!

    Brian

    0
  • Brian Scavullo
    Comment actions Permalink

    I was able to get it to work in the end, but we had to use a different code.

    The one you guys provided, unfortunately, didn't work for me.

    It'd be great to see if there's an easier way.

    -Brian

    0
  • Jessie Schutz
    Comment actions Permalink

    Hey Brian!

    I'm so glad you got it figured out! Feel free to share the code you used in our Tips & Tricks section; you'll even get swag as a thank you!

    0
  • Brian Scavullo
    Comment actions Permalink

    Hey Jessie!
    Thanks for getting back to me. I've added it here: 
    https://support.zendesk.com/hc/en-us/community/posts/360000552248-Adding-agent-badge-in-Communities
    Brian

    0

Please sign in to leave a comment.

Powered by Zendesk