Help Desk Icons only visible to Managers and Agents

4 Comments

  • Socorro Fernandez

    Hi MT,

    I was able to get my Zendesk Icon to hide/Show based off role with your script and code. Seems like the script is not running for you.

    Can you confirm if the script is within the document.ready part of the js?

    Screenshot example:

     

    Are there any other scripts impacting div.manger?

    Thank you and please let me know.

     

    0
  • MT

     It wasn't in a document.ready function, but placing it in one did nothing. It appears as though we have multiple document.ready functions within the js page, could this be affecting the expected result?

    We have this in the CSS page:

    div.anonymous, div.end_user, div.agent, div.manager {
    display: none;
    }
    0
  • Socorro Fernandez

    Hi MT,

    It may be possible they are conflicting but I am not 100% certain. If the scripts within both document.ready are working then maybe its something else.

    You could try putting the script on the very end of the HTML page directly where the icons are to see if it runs then. For Example, if they are on the home page, add the following script at the end of the code on home_page.hps

    <script>
    $(document).ready(function() {

    if (HelpCenter.user.role=="manager" || HelpCenter.user.role=="agent"){
    $("div.manager").show();
    }

    });
    </script>

    I tested on my end and working as well. Thanks MT. Let me know.

    1
  • MT

    Adding the script to the end of the .hps page worked. I'm wondering if the code wasn't in the correct document.ready. Ahh well. I'll do some further digging, but this is great for now.

    0

Please sign in to leave a comment.

Powered by Zendesk