Question
How can I hide article comments using curlybars?
Answer
Instead of disabling comments for each article using the Open for Comments option, you can hide parts of Help Center articles, like the comments section with a few lines of HTML. In this example, we hide the comments section of the article page. This also hides already existing article comments.
- In Guide, click Guide admin followed by the Customize design icon (
) in the sidebar.
- Click the theme you want to edit to open it and then click Edit Code.
- In the Templates section, select the Article_page.
- The HTML in the article page might vary depending on your Theme and customizations. Look for the Article comments curlybars on that page.
- Add {{!-- before the <div class for the comments, and --}} after the </div> for the comments. This adjusts the color of the text to brown, indicating that this section of code is being blocked out.
Click Publish and then Preview to watch your article comments disappear.
You can use this trick for hiding anything on the article page, see the article Selectively hiding Help Center components using Curlybars. The best practice for this is to put the {{!-- --}} before and after the open and close <section> tags. Hiding information like this allows you to see what is hidden, instead of removing code which can be confusing to find what is missing.
2 Comments
Is it possible to make comments visible to only a particular segment or user tag?
There is no native functionality in the support interface that allow you to just make a comment visible to a particular segment or user tag. You can use segments to restrict access to entire articles, in your help center, that will include the comments in the article. For more information, you can check this article: Setting view permissions on articles with user segments.
I hope this information help.
Please sign in to leave a comment.