Section TOC in category
Hi,
The number of sections within a category is exdanding in our knowlegde base. We would like to add a table of content in the category overview so people can more easily navigate between the sections.
Do you have an example available to get us started?
Regards,
Robin
-
Hi robin van Doorn -
I see that this is your first post. Welcome to the Zendesk Community! If you'd like to introduce yourself to everyone, you can do so here.
To answer your question, this does require some customization. The good news is that another user has shared how they built a table of contents in our User Tips & Tricks topic. Give this a look:We'll also share your question in our weekly digest, to give it added visibility and see if any other users have examples or can help you out.
-
Hi Nicole S.
Is your reference to creating a table of contents within articles?
I think what Robin was looking for is creating some sort of table of contents of sections at the category level, rather than a table of contents based on headers within an article.
And by the way for the article table of contents that's already native functionality on an article level.
Sorry, if I missed something or misunderstood the original question but I don't think your comment answers it.
Thanks.
Catherine
-
Ah, you're correct, Catherine. Thank you for pointing those items out, and Robin, my apologies for misreading your question.
If any other users can help Robin with how to do a custom build for a table of contents at the category level, please share. :) -
I managed to create the table of content with a double loop on the sections object. Don't know if its the most optimal solution but it works for now
-
robin van Doorn, I am not sure what that means, please share your solution / code if possible.
Nicole S., is there anyone that can help review if this solution is ok to copy? thanks!
-
HI Catherine - We can ask if any of the community moderators can review it.
-
I've been trying to solve for this too recently with Guide Enterprise' ability to nest sections within sections and a table of contents sort of structure is something I'd like to explore. Most of the content that I've found is older, and with the Guide Templating API v2 out, I'm trying to build something in that light. I would love to see what others have come up with as I was only able to get the contents to go down two section levels before the curlybars logic stopped working on me.
My current iteration isn't really sharable as I'm in the middle of it, but it largely follows what the Docs theme that Zendesk used to have in their Zendesk Labs Github repo. I was able to find a few other repositories where other users have hosted the same code by searching for Zendesk Doc Theme on Github - the home_page.hbs has the general curlybars code structure in there (though without nested sections).
-
Catherine Michalak Sure I can.
<div class="category-toc">
<ul class="section_toc">
{{#each sections}}
<li><a href="{{../category.url}}#archor-{{id}}">{{name}}</a></li>
{{/each}}
</ul>
</div>
Please sign in to leave a comment.
8 Comments