Hiding article comments with curly bars Follow

Comments

11 comments

  • Avatar
    Mandeep Singh

    This is super helpful! Thanks Ray

  • Avatar
    Tim Finney

    Hello,

    Is it possible to have comments be internal or moderated? Or are comments simply 'on' or 'off'?

     

    Thanks,

    Tim

  • Avatar
    Jessie - Community Manager

    Hey Tim! I just answered your question over here: Disabling Social Media and Comment options in Help Centre

  • Avatar
    Jacob J Christensen

    Thanks Ray, just what I needed.

  • Avatar
    Danielle Dalton

    Thank you for this post! Since the Follow button at the top only relates to comments, does anyone know how to remove the Follow button? It's irrelevant if comments don't exist. Thank you!

  • Avatar
    Jacob J Christensen

    Hi Danielle,

    You're right about the follow button on articles is only for comments - but it is also available for Sections, where it notifies followers of any new articles appearing in said Section (or articles being moved to this section).

    So while it will make sense to remove the button on the article template you may want to consider leaving it on the Section template. 

    In any case it is called {{subscribe}} in the markup, you can either delete it or replace it with {{!-- {{subscribe}} --}} , so you can easily change it at a later time.

  • Avatar
    John Yu

    Image links are broken, please fix it when possible. Thanks.

  • Avatar
    Jake Bantz

    Hi John,

    Thanks for the heads up! It looks like they were pointing at an internal location. I have fixed the images so they are available to all.

  • Avatar
    Bridget de Gier

    I'd love to know is it possible to hide the comments on just certain categories?  We have our guide set up to provide articles on how to use our software but some categories are also configured to just provide notifications.  We'd like our users to be able to add comments to the user articles but not on the notifications.  Is this possible?  Can the comments be restricted to certain categories or sections only?

  • Avatar
    Trapta

    Hi @Bridget,

    There are two ways of doing it, you can use JavaScript and write a function to hide it for certain categories or you can mark all the article from article content editor to make an article 'Open for comments' or not.

    Team Diziana

  • Avatar
    Jake Bantz (Edited )

    Thanks Trapta!

    Another solution would be to hide the comments by using Curlybars. Unfortunately we cannot hide the comment section by category, but we can hide it by section. Where Ray has used the {{!-- and --}} above, you could instead insert something like this around those blocks of code:

    {{#isnt section.id 1234}}
    {{#isnt section.id 3456}}

    Existing code here...

    {{/isnt}}
    {{/isnt}}

    Using the isnt helper will only show the comment blocks if the section is not one of the sections highlighted above. If you are interested, I go into a bit more detail about this sort of scenario in this article: https://support.zendesk.com/hc/en-us/articles/115011134947-Selectively-hiding-Help-Center-components-using-Curlybars

    Hope that helps!

Please sign in to leave a comment.

Powered by Zendesk