Question
Can I put an article or section in multiple sections or categories?
Answer
In the Help Center, content is organized in aHome > Categories > Sections > Articlesstructure. With default functionality, a section can only be in one category and an article can only be in one section.
However, you can display a link to the section or article on the page you'd like it to also be available bycustomizingthe template page for the section or category.
Using theisproperty, you can code in the reference to display the content in the additional section or category. For more information, see the article:Help Center Templates. To do this, you need the ID of the section or category. This can be found at the end of the section or category URL that you want to add the content to. For example,https://yoursubdomain.zendesk.com/hc/en-us/categories/#######
Add article to section
Add section to category
Add article within the helper
To add an article to a section
{{#is section.id ######}}
alt text
{{/is}}
To add a section to a category
{{#is category.id ######}}
alt text
{{/is}}
To add an article to the category page within the {{#each section}} helper
{{#is id ######}}alt text
{{/is}}
If you add an article or section to an empty section or category, the process is different and involves incorporating the if/else statement used to display an empty link within the category or section.
For adding an article to an empty section there is an{{#if section.articles}}statement. Within that statement, the{{else}}statement should look like the below script.
{{else}}
{{#is section.id ######}}
{{else}}
{{t 'empty'}}
{{/is}}
{{/if}}
For adding a section to an empty category, the{{else}}statement looks like the below script.
{{else}}
{{#is category.id ######}}
alt text
{{else}}
{{t 'empty'}}
{{/is}}
22 Comments
I am trying to use the syntax below in a category template, unsuccessfully. I am unsure where in the page HTML, I should place it. Can someone share an example?
It looks like my colleague is already working with you on a ticket with the same query. Please respond to the existing ticket ️
Thank you.
Is it possible to access the "category" object on an "article" page template?
我在代码编辑器中说我越来越错误can't access "category". Is there a workaround for this?
This does not work.
Hi Bryan,
你能提供任何额外的细节you're seeing, what you've tried, etc? We aren't sure how to help troubleshoot without a little more info.
How can I reference two ids to use the same image? This doesn't work and I don't know the right syntax.
{{#is id 1##### 2#####}}
{{is}}
Hey,Heather Firth!
The #is helper only allows for two parameters to be present so to have two separate IDs reference the same image, you’ll just need to split the IDs in to two separate #is statements:
I hope this helps! Let me know if you have any questions.
Tipene
I was able to add an article to a section ok, however, the article doesn't show up on the category page so am now trying to also add the article to the section on the category page and am using the below code.
Is this correct, and more importantly, where would I place this? Thanks!
Article Text
{{/is}}
HiDerek Hixon,
The code looks good to me! You'll want to place that in the category_page.hbs file within the {{each #sections}} helper, which sits below the div with the ID "main-content".
ThanksTipene Hughesall set now, cheers!
hi!
We are trying to display one article across several sections in Zendesk. We're using this community article to add code to our theme.
We successfully got an article to show up under another section in our zendesk sanbox tenant (see attached), but we can't get the article to also show up on the category page under that section.
Test Case
Original Article Placement:
- Category:Working at Twitch
- Section: Recruiting
DUPLICATE SHOWINGS using Code
On Section Page - SUCCESS:
- Category: Manager Toolkit
- Section: **Create and Manage Headcount
Added the following code to section_page.hbs, line 48:
{{#is 360010025532}}Who" rel="nofollow noreferrer">https://twitchpeople1568844680.zendesk.com/hc/en-us/articles/360048464891">Whois my Recruiter?
{{/is}}
Under Section on Category page - FAIL
Added the following code to line 44 of the category_page.hbs
{{#is id 1568844680}}
Who" rel="nofollow noreferrer">https://twitchpeople1568844680.zendesk.com/hc/en-us/articles/360048464891">Whois my Recruiter?
{{/is}}
TL;DR: The code successfully made the article appear on the category page but not under a section, we want it to appear undercreate and manage headcount.It does appear there when you open that section page.
Hi Rachel! To see what might be going on, I'll need to take a look at your account. I'll open up a private ticket so that we can continue this discussion without sharing any account info here. Talk to you shortly!
EDIT: I've got this figured out to display in the category and section when you actually click into the category and section, but it doesn't show in the accordion drop down on the Home page. I'm still messing with this but any help would be appreciated.
If needed, is there any way to get a ZD Developer Advocate to get on a Zoom with me and walk me through some things via screen share?
EDIT #2: Figured it out. You have to put the same code on the home_page.hbs under the {{#each section}} helper. Play around with putting it under different areas to get it to display how you want.
Here is my code for Sections:
Here is my code for Categories and Home page:
Notice I took the
Can you share a little bit more on what you're trying to set up? Our Advocates are unable to support custom code so if you're looking for some help customizing your Help Center then we'd most likely need to get you in touch with our Professional Services team.
Otherwise if you create a post in ourZendesk Suite Q&Awith what you're trying to set up then some of our experienced community members can jump in and point you in the right direction :)
Let me know!
Hi Team,
We're currently trying to display a single article in multiple sections. Using the "add an article to a section" code above, I've been able to get a link to the article appearing in another section (Example Article). However, I can't get it to appear in the format of the original articles in that section (Articles 1, 2 & 3).
Is there anything I'm missing here? It could be that I am not inserting the code in the correct location within the section_page.hbs! Any advice would be great!
HiJacob Smith
On our site, we have this code added between these lines in the section page:
But we also added the same class to these cross-posted links as the others, so they format the same.
Example:
Hi Kaarina,
Thanks for your response, I've had a go at what you have suggested above but haven't had much luck doing it this way. I don't seem to have the code below on the section page
Does anyone have any further advice on how I can display the same article in multiple sections?
HeyJacob Smith,
You'll need to ensure you have the correct class names applied to the appropriate elements for the styling to display correctly. Can you try adding the class name that you have onArticles 1, 2, and 3in your previous comment to theExample Articlelink.
Let me know if you have any questions!
Tipene
Hi team,
I tried to add an article to multiple sections. I added the code suggested above to the section_ page. However, the article did not show up in another section. Where I should put the code?
Hi,
I'd like to show in a custom page a list of article that got a certain tag can you provide the code to do it please?
Thank you,
Raphaël
Did anyone manage to get it within the list? It throws an error if you put it within the each section. It works if you put it outside of it but it's not in the list.
Heather, make sure you're adding it in the right area of the code. That section id code looks right.
Pleasesign into leave a comment.