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

Comments

9 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.

Please sign in to leave a comment.

Powered by Zendesk