Restrict Custom block at home page based on user group

14 Comments

  • Jennifer Rowe
    Comment actions Permalink

    Thanks, Diziana! You know we always love your tips!

    1
  • Joe Palmieri
    Comment actions Permalink

    Hi there,

    When 'lurking' around in the source code, I found this message, right above the declaration of the HelpCenter.user object:

    We also use this object's values to restrict content based on users (e.g., only show feature x to authenticated users).

    Is this note still accurate? In other words, should we be worried about the HelpCenter.user object being removed in the future (and thus breaking our current Help Center's functionality)?

    The above code is from an inline script included in the html of https://[brand].zendesk.com/hc/en-us

    0
  • Jessie Schutz
    Comment actions Permalink

    Hi Joe!

    The note is accurate. It doesn't necessarily mean that anything is going to change, but we can't promise that changes won't happen as Zendesk continues to grow and evolve. We don't want your stuff to break in the event that happens because we won't be able to help you fix your customizations, which is why we put the note there.

    Please let me know if you have other questions, or need any further clarification!

    0
  • Joe Palmieri
    Comment actions Permalink

    Thanks, Jessie! Totally makes sense. We'll use this cautiously and won't blame you if it ever changes :)

    0
  • Tobias Eriksson
    Comment actions Permalink

    Thank you! Been looking for a way to do this a couple of days now!!! Cheers!

    I changed the JS from <li> to <p> and it looks like it works as well! 

    0
  • Diziana
    Comment actions Permalink

    @Joe: It's good idea not to use any undocumented stuff, we try not to. We are working to find a way to replace code which uses HelpCenter object anywhere.

    0
  • Diziana
    Comment actions Permalink

    @Tobias: We are glad that it helped you.

    @Jennifer: Where is our goody for the tip? ;-)

    0
  • Jennifer Rowe
    Comment actions Permalink

    Hey Diziana,

    I sent you something via email a few months back, but it looks like it was never redeemed. Email me at community@zendesk.com and I'll give you the link again! You've definitely earned it. :)

    0
  • Jean-Michel WEISS
    Comment actions Permalink

    Hi,

    HelpCenter is an undocumented object, i know that the HelpCenter.user.tags exists, do you know if HelpCenter.organization.tags exists, and if there is a hidden link where i can get all the arguments that i can use, like the place holder ? it would be nice

    0
  • Jimmy Lin
    Comment actions Permalink

    Hey Jean-Michel WEISS -

    You can type HelpCenter into your browser console on a Zendesk Help Center page and see the results for yourself.  I just did it now while typing out my comment and I do see that my organizations and the organizations tags are listed.  So you should be able to get the data as well.

    0
  • Jean-Michel WEISS
    Comment actions Permalink

    Not working on my side, Jennifer Rowe, an idea ? anyway thanks for the advice

    0
  • Bryan - Community Manager
    Comment actions Permalink

    Hello Jean-Michel WEISS -- organizations are at the user level of the HelpCenter object -- it looks like you may be checking at a higher level (HelpCenter.organization.tags):

    0
  • Jean-Michel WEISS
    Comment actions Permalink

    on my side, there is no HelpCenter.organization, only HelpCenter.user.organization, any idea ? thanks again

    0
  • Bryan - Community Manager
    Comment actions Permalink

    You're right. There is no HelpCenter.organization value. The organization information is tied to the signed-in user. If you need the overall set of Organizations for an account, you'll want to call the GET /api/v2/organizations.json API.

    0

Please sign in to leave a comment.

Powered by Zendesk