Curlybars lets you hide components in your help center, such as the article, section, category, community topic, or community post. To do this, add conditional statements in your theme code that target the unique ID number of the component you want to hide.
This customization is available for the Guide Professional and Enterprise plans, and the Suite Growth plan or higher. The workflow includes the steps below.
Step 1: Find the component's ID number
Each component has a unique ID. The ID number appears in the URL when you navigate to the component's page.
To find the unique ID number
- In your help center, navigate to the component. For example, click a category if you want to hide the category from your help center.
- Find the URL in your browser's address bar and get the unique ID number. The URL has the sample format
/hc/en-us/categories/200420805-General
. In this example, the number200420805
is the unique ID of the component. Take note of this number. - Repeat the steps to get other unique ID numbers if you need to hide multiple components.
Step 2: Edit the theme code
Access your theme code and add the isnt helper expression. When you use the isnt
statement on a component's ID number, your theme won't render the targeted component and hide it from your help center pages.
To access your theme code
- In Guide, click Guide admin.
- Click the Customize design icon (
) in the sidebar.
- Find your live theme and click Customize. Then, click Edit Code.
- Find the page you want to edit in the templates folder.
To add the isnt statement
In this example, the Copenhagen theme is edited to hide the Announcements and Unlisted categories from the home page. They're still accessible to users with a link to the categories and their articles.
- In the templates folder, click home_page.hbs to access the home page template.
- Add the
isnt
statement with the unique ID number of the component. Repeat the code if you need to target multiple components. - Click Publish. To check that the components disappeared, click Preview.
What's next
Use the isnt
statement to hide other components from your help center and community pages. Select a template file in your theme and target the component's ID. In this example, an article is removed from the sections list in the sidebar, but is still accessible through search or direct link.
To achieve this, add the isnt
statement with the article ID to the article_page.hbs template file.
For more information, see the article: Customizing your help center theme.
65 comments
Bob Garber
Can this be used to hide specific file types in attachments?
We are publishing a lot of DITA image files into KB and they are mostly all .png files.
These end up as a huge list at the bottom of an article, which we don't want to see or need.
We just want to block .png's. All of the other attachments we post are PDF's, Word, Excel, type files.
Thanks.
BobbyG66
0
Ifra Saqlain
Hi Bob Garber, you can check (with if condition) the file type using JS and then hide this (png files only)
Thanks.
0
Bob Garber
Thanks Ifra,
I wrote this code, but it is hiding all file types. Not sure if I have something in the wrong order, or if the code is wrong.
0
Ifra Saqlain
Hi Bob Garber,
Add the code at the bottom of your script.js file:
Make sure document_head.hbs file must have jQuery CDN:
1
立松貴央 TakaoTatematsu
Vlad
Thank you for your advice the other day. https://support.zendesk.com/hc/en-us/articles/4408845769882/comments/4483557247642
The way you taught me helped me achieve what I wanted to do!!
0
Bob Garber
Thanks Ifra!!!
That code worked perfectly! I owe you a coffee!
Bob
0
Maximilian Kreisler
Ifra Saqlain is it possible to hide certain elements of the page based on a URL parameter?
We would like to hide the header (as well as other elements) when the support page is visited from the web view from an app.
0
Ifra Saqlain
Hi Maximilian Kreisler, yes you can hide using JS or CSS.
Add CSS at top of the homepage like below. I add this code at home_page.hbs because I'm hiding it only for homepage not other pages.
-
0
Lumi
HI, is there a way to hide articles from Search Results and/or Section page by labels or content tags. Essentially, if an article has the content tag 'abcdef', don't show it in the Search results? Thanks in advance!
0
Vlad
- as far as I know, this is not supported by ZD, so it's not doable.
0
Lisa Sedlak
Jake Bantz
We are going to do a Beta test of a product. We want to link to articles in our help center, but don't want those showing up in a list or category, however. we DO want the direct link the the article show up.
For example:
Let's say we have an iOS app for our product and we need to Beta test it. We have links in the iOS app that lead to how to use the app, but since the app is not available for use yet, we want to hide the articles, but have those testing to be able to see the articles (without having a Zendesk account).
Is this possible?
0
Lila Kingsley
Lisa Sedlak we did something similar in our public help center. We hid specific articles from displaying in Category, Section and Article sidebar navigation cribbing Jake's code from his article_hide_in_sidebar.txt attachment. Basically as he says you follow the convention of adding the isn't helper after the #each helper for articles in conjunction with the article id i.e. {{#isnt id 1234}}
For more than one article you add multiple {{isnt}} and close each with {{/isnt}}. I wanted/preferred to use labels instead of individual article ids but wasn't able to get that working.
Here's what our category_page.hbs code snippet looked like as an example (I just added the stuff surrounded by comments.
0
Jake Bantz
Lisa Sedlak, Lila is right on with their suggestion.
There is a limitation that using these workarounds, it is not possible to hide the article from search (this is discussed a little earlier in the comments on this article). A possible workaround would be to instead use a custom page for the 'hidden' documentation, and provide those Beta users with the destination of that page.
Hope that helps.
0
Ari
I’m using Zenplates’ Ruby theme and want to selectively hide about 12 articles from a category page and some of its sections.
I’m still trying to figure out where to put the {{isnt id… codes for the theme templates, but my question is whether I need to include any html elements between the opening and closing {{/isnt}} since the intention is that those list items do not render.
0
Lila Kingsley
Ari the isn't helpers surround the code block that lists articles. So essentially it's saying list the articles which are not the article id specified in the helpers. You shouldn't need additional html.
As far as location, you put the isn't helpers after the each articles helper on the category, section and article templates (see my comment above for full code snippet I used):
NOTE: I hid articles in ALL categories/sections/articles which is a bit different than what you want to do...but I would think you could possibly use if/else + the isn't helpers for that.
https://developer.zendesk.com/documentation/help_center/help-center-templates/introduction/#conditional-helpers
0
Alyssa
Is there a workaround to hide an article from search as well? Ifra Saqlain perhaps you've cracked this?
Please Zendesk, let us publish unlisted articles 🙏🏼
0
Abhishek Tiwary
Hello Zendesk support,
Can I hide a specific article from all the sections?
For example, I have articles with the title, "Oxygen Publishing Metadata - do not delete".
I need to hide this article from all the sections across all the categories.
Regards,
Abhishek Tiwary
1
Ifra Saqlain
Hi Abhishek Tiwary,
Solution 1
Check the article id on section page and category page using
Category Page:
Section Page:
Solution 2
Make your article set as draft in your help center.
If any confusion feel free to ask.
Thanks
0
Abhishek Tiwary
Thank you Ifra Saqlain,
My help center has many articles with the same title. I was thinking if it was possible to hide all of them at once using the article title?
Regards,
Abhishek Tiwary
0
Ifra Saqlain
Abhishek Karn,
copy the given code and paste it at the bottom of your script.js file,
Now, your article would be hidden from all pages if exists.
Make sure article title is correct which I mentioned in the above code
Oxygen Publishing Metadata - do not delete.
0
Abhishek Tiwary
Thank you Ifra Saqlain,
This was a great help.
Regards,
Abhishek Tiwary
0
Niraj Makwana
So I have used this article to hide sections and it works, but the problem I'm having is, that an an agent the section and articles also become hidden for me. How do I do it so that the normal users can not see the hidden sections but and an admins/agent I see can. I think the only option can be is making each articles set to "Visible to Agents". but there are so many I'd have to set up in that way, any ideas?
0
Christopher Kennedy
To make articles visible to agents only, the simplest approach would be to change the article permissions as you suspected. This is also possible to do in a bulk update.
0
Paolo Votta
Hi everyone,
Is it possible to hide the community button in the header of the homepage?
We are in a testing phase and we do not want our end-users to see it for the moment.
If possible could anyone share a code example?
Thank you in advance for any input.
0
Christopher Stock
Hey Paolo Votta, the community button won't appear if you do not have the community activated on your help center. But you can see it when you're in development mode.
You can also remove the code from the header.hbs file, you're looking for {{link 'community'}}
1
Greg Katechis
0
Paolo Votta
Hello and thank you for your help! The thing is that I need the community to be activated but only visible to internal agents in this moment. Later on I will try to extend it for a specific user segment. It would be a great improvement if you can restrict the visibility of the community by user segment, and NOT only posts visibility, but the entire community. For the moment I will remove the community button from the code as it was suggested.
Thank you for taking the time to reply to my question!
0
Abdelhameed Khaled
If I have multiple forms how to get the URL of each one of them . I want to include each of them in different articles of categories because I will hide submit a request
0
Ifra Saqlain
Hi Abdelhameed Khaled,
Open your submit a request page and select the first form from the dropdown.
You will get the URL of that form in the searchbar, copy that, and use it wherever you want.
Again select the second form from the dropdown copy URL and use that.
If any issues feel free to ask :)
Thanks
0
Abdelhameed Khaled
Hi Ifra Saqlain thanks
Ok there is an issue . when I paste the URL in an article for example it still offer the drop down menu . what I want is to only show the specific form which I provided the link for so that customer or viewer cannot choose another one how to do this . is it possible from the code?
0