Hide comment section info if an article has comments disabled


  • Sheldon Grimm

    Hi David,

    Great tip, thank you for sharing!

    I've already implemented some of these ideas into our Help Center after reading your post.

    Aside from CSS changes I made to accommodate this, I decided to place the <header class="comment-overview"> within the {{#form 'comment'}}:

     <div class="article-comments" id="article-comments">
    <section class="comments">
    {{#form 'comment'}}
    <header class="comment-overview">
    <h3 class="comment-heading">
    {{t 'comments'}}

    In my case, this helps hide the border-top attached to the comment-overview (that I want to keep for when comments are enabled). This may be useful for others with similar border setups for comments, which I believe is default.



  • David Raboy

    Awesome! Thanks for letting all know. The more we add the better.

  • Jessie Schutz
    Zendesk Team Member

    Thanks for sharing this awesome tip, David!

    And Sheldon, thanks for adding your code! :)

  • Jennifer Rowe
    Zendesk Documentation Team

    David, another great tip from you--thanks! I love this one. 

  • Lenka Prochazkova

    Hi David,

    I tried your code and it doesn't seem to work. Is it written for a certain Zendesk theme?

    We are using Humble Squid that we heavily customized. Anything I wrap in the `{{#form}}...{{/form}}` won't show at all. I tested with all different types of articles – such as articles with comment disabled, articles with comments etc. I always get the same result.

  • Jessie Schutz
    Zendesk Team Member

    Hi Lenka!

    This code is specifically for the Copenhagen theme, which I suspect why isn't working for you. I'll check with some of our Community Moderators to see if they have any insight to share on this!

  • Trapta Singh
    Community Moderator

    Hi @Lenka,

    Can you please specify what you are trying to wrap in the {{form}}..{{/form}}? There are possibilities that the component you are adding inside the form is not allowed and that is why it is showing error.

    Please provide little more detail on what you are adding and what is it showing. That will help us in debugging the issue and proving a fix to you.


    Team Diziana

  • Lenka Prochazkova

    Thank you for getting back to me, Jessie and Trapa.

    I tried to follow the tutorial and wrapped the form around the Header. I was hopping that the bold headline "Comments" would be removed when comments are not allowed on an article page. :)


Please sign in to leave a comment.

Powered by Zendesk