Hide and show My Activities and Submit a Request (Help Center) Follow

Comments

10 comments

  • Avatar
    Marybeth Sklar

    How can I hide the home page search bar from unauthenticated users? We check to see if a user is anonymous and present a notification if they are (thanks Wes). Now I'd like to hide the search bar, because we're getting 0 results returned for search terms due to unauthenticated users trying to search. Here's what Wes helped craft in JS:

    if (HelpCenter.user.role == "anonymous") {

        $('.notification').slideDown('fast'); 
    

    }
    Thanks in advance.

  • Avatar
    Thibault

    It seems the function HelpCenter.user.organizations. can not be used anymore ?

    Is it a side effect of the new helpcenter ? if yes, then what to replace it ?

  • Avatar
    Toni Delli Compagni

    Hi,

    I'm trying to hide the 'my activities' button.  Our company does not use tags for our end users, we would like to hide the button from all our users.

    I think I have followed the instructions correctly, I've only used the CSS code provided above, not used the JS at all as we don't use tags.  When viewing the Help Centre in editing mode, the button is not visible: http://screencast.com/t/OeaY7dg3 But when viewing the live site the button is visible: http://screencast.com/t/muZHSYHm1fh

    Please can you let me know where i have gone wrong?  I'm not very experience with CSS, so please go slow....

    For now, I have set out Help Centre to Set-up Mode

    Thanks,
    Toni

  • Avatar
    Toni Delli Compagni

    Got it!  It helps to publish the change.  Thanks again for the tutorial above

  • Avatar
    Jessie Schutz

    I'm glad you were able to get it working, Toni!

  • Avatar
    Rafael Cueto-Felgueroso

    Hi, 

    I've put this code in the JS section of the main page:

     

    (function() {

    var isUser = false;

    HelpCenter.user.tags.forEach(function(x) {

    if (HelpCenter.user.tags=="usertag") {

    isUser = true;

    }

    });

    // Checks if the tag was found or not

    if (isUser === true) {

    alert('I have the tag you are looking for!')

    }

    else{

    alert('I have a different tag!')

    }

    }());

     

    But it does not work. Puting alerts along the code I see it breakes in the follwing line:

    HelpCenter.user.tags.forEach(function(x) {

     

    Any idea?

     

    Thanks,

     

    Rafael C:

     

  • Avatar
    Julien

    You have to put the code after :

    /*
    * jQuery v1.9.1 included
    */

    $(document).ready(function()
    {

     

    If you put it before, it wont' work.

  • Avatar
    Rafael Cueto-Felgueroso

    Oh, my God, I'm ashamed... Thanks a lot, it works fine now!

  • Avatar
    Julien

    No prob. I'm happy it's solved your problem. Have a nice day.

  • Avatar
    Micah Adamson
    FYI:
    We were able to duplicate the customization to prevent unpaid customers from seeing the "+ Submit a Request" button in the Help Center to hide another way for unpaid customers to open a service request from the directly link to https://<company>.zendesk.com/hc/en-us/requests/new published in our app.
     
    Here are the steps we used to hide the support request form based on the paid customer tag:
    • Added: id="requestForm" - inside the <div class="form"> tag in the New Request Page:
       <div class="form" id="requestForm">
    • Added: #requestForm - to the list of elements to hide in CSS:
       a[href$='requests/new'], a.submit-a-request, .my-activities, #user-menu .my-activities, #requestForm {
             display: none;
          }
    • Added: $('#requestForm').show(); - to the list of elements to hide in JS:
       if (isCust === true) {
        $('a[href$="requests/new"]').show();
        $('.my-activities').show();
        $('#user-menu .my-activities').show();
        $('a.submit-a-request').show();
        $('#requestForm').show();
        }
    • Added: A note to the bottom of the New Request Page saying:
       "Please confirm you are signed in with your account to open a support request and see the following article for more information about if you are eligible to open support requests."

Please sign in to leave a comment.

Powered by Zendesk