Flexible Hierarchies enable you to add subsections (sections in sections) to your help center knowledge base. You can use subsections to create more levels in your knowledge base's hierarchy, up to six levels deep.
By default, the standard Copenhagen theme's section page template displays a list of each section's subsections. You can modify the theme's code to display subsections using other page templates or to change the look of the subsections lists.
You can only show the direct subsections of a section. You cannot show multiple levels of subsections.
Showing subsections on category pages
You can update the template to display subsections below each section's articles.
To customize the category page template
In the category page template, insert the following block after <section
class="section">
:
{{#if sections}}
<ul class="section-list">
{{#each sections}}
<li class="section-list-item">
<a href="{{url}}">
<span>{{name}}</span>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
focusable="false"
viewBox="0 0 16 16"
aria-hidden="true"
>
<path
fill="none"
stroke="currentColor"
stroke-linecap="round"
stroke-width="2"
d="M5 14.5l6.1-6.1c.2-.2.2-.5 0-.7L5 1.5"
></path>
</svg>
</a>
</li>
{{/each}}
</ul>
{{/if}}
Showing sections and subsections as blocks
You can customize the Copenhagen theme's category page template to display sections as blocks.
Similarly, you can customize the sections page template to display subsections as blocks.
To customize the category page template
<div id="main-content"
class="section-tree">
tag and its contents with the following
snippet:<section class="categories blocks">
<ul class="blocks-list">
{{#each sections}}
<li class="blocks-item">
<a href='{{url}}' class="blocks-item-link">
<h4 class="blocks-item-title">{{name}}</h4>
<p class="blocks-item-description">{{excerpt description}}</p>
</a>
</li>
{{/each}}
</ul>
</section>
To customize the sections template
{{#if section.sections}}>
block and its contents with the following
snippet:{{#if section.sections}}
<section class="sections blocks">
<ul class="blocks-list">
{{#each section.sections}}
<li class="blocks-item">
<a href="{{url}}" class="blocks-item-link">
<h4 class="blocks-item-title">{{name}}</h4>
<p class="blocks-item-description">{{excerpt description}}</p>
</a>
</li>
{{/each}}
</ul>
</section>
{{/if}}
11 comments
Peter Toprac
Hi, where do I add a code for the category in category_page.hbs? Do I delete a part of the old code or do I just need to add the code somewhere in the original code?
1
Rick N.
Thank you for reaching out to Zendesk Support Advocacy team. My name is Rick and I'll be assisting you today.
If I understand this correctly, then this is the best guide to follow on adding Category : Adding Multiple Category, Section, Article
On the other hand, if you wish to do it via source code it would be best to coordinate it with your devs team as we provide limited support to customization specially via source code.
Hope this helps. Should you have further concern, feel free to respond on this thread.
Cheers
-6
William Villegas
Most articles specify the location to copy the code. It's simply copy/paste, no dev needed if you specify where to copy the code. Rick N. - The link you posted is not helpful.
1
James Rodewig
Thanks for the feedback William Villegas. I've updated the article to provide better guidance on where to include the code. If you notice anything else that needs improvement, please let us know!
0
Emily Yeomans
What part of that HTML is for the section font size? I'd like it a bit smaller.
0
Madison Hoffman
Hi Emily, you can alter the font size of the titles by changing the h4 tags in this line to something else (h5 or h6 as demonstrated here):
If you're looking to alter the description font size, note that this is just using whatever paragraph font size is specified in your site's CSS file:
1
Brad Westman
How do we open a ticket when our subdomain has been deleted?
0
Dane
You can follow the steps in Contacting Zendesk Customer Support.
0
Madison Hoffman
Hi Brad, can you share your question here? Our product support team can only help registered agents & admins of existing Zendesk accounts, but depending on your question we may have a way to make an exception (or provide alternate instructions if you need to reach a different team).
0
Sana Stephens
I have a Category with 10 sections with articles in each section. However I have one section that has only 2 additional sections with articles in those subsections but the two sub section aren't displaying on the category page. I have to click into the section to see the sub sections. Is there a way to update the HTML to display the down to the 3 level of sub sections?
Specifically the 3rd level sub section isn't displaying on the Category or Section pages. I have to click into the 2nd level section to see the 3rd level sections and the underlying articles in those sections.
0
Paul LaBarbera
Can I show subsections on a section template? See the screenshot below. I've got a section page here, and some of the sections within it have articles. Those are displayed on the section template. Some of the sections have subsections. How can I have those appear on the section template?
0