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
By default, the Copenhagen theme's category page template doesn't display the subsections of each section. 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 before the closing tag of
<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}}
9 Comments
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?
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
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.
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!
What part of that HTML is for the section font size? I'd like it a bit smaller.
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:
How do we open a ticket when our subdomain has been deleted?
You can follow the steps in Contacting Zendesk Customer Support.
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).
Please sign in to leave a comment.