Hiding the widget button via zESettings object

3 댓글

  • Simon Blouner
    댓글 작업 고유 링크

    Hey Ramesh,

    There's plenty of different topics on the Zendesk commnity about this - some them outdated, some of them with wrong info.
    By implementing the following, it will work with the latest version of the Widget API.

    1. Add your Widget Script to your header.

    2. Add the following  script to your HTML page or javascript file. If in javascript file, loose the <script> tags:

    <script type="text/javascript">
            zE('webWidget', 'hide');
            $( document ).ready(function(){
                $( "#showWidget" ).on( "click", function() {
                zE('webWidget', 'show');
                zE('webWidget', 'toggle');
        });
    });
    </script>

    This script is listening to an HTML element with the ID of showWidget, e.g. 

    <div id="showWidget">Open Widget</div>

     

    #helpsome regards,
    Simon Blouner
    Zendesk Consultant @ helphouse.io

    1
  • Fernando Duarte
    댓글 작업 고유 링크

    @simon   How can I implement this to hide the Widget in Guide based on user tags?

    0
  • Simon Blouner
    댓글 작업 고유 링크

    Hey Fernando,

    To the best of my knowledge I'm afraid this is not possible in a simple way as above.

    In theory, it should be possible to code a GET request based on the id available in the {{user}} object - but unfortunately, it seems like this object is only available on the User Profile Template, which doesn't make it a possible scenario anyways.

     

     

    0

댓글을 남기려면 로그인하세요.

Zendesk 제공