Section TOC in category

8 Comentarios

  • Nicole - Community Manager
    Acciones de comentarios Permalink

    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. 

    0
  • Catherine Michalak
    Acciones de comentarios Permalink

    Hi Nicole - Community Manager

    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

    0
  • Nicole - Community Manager
    Acciones de comentarios Permalink

    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. :) 

    0
  • robin van Doorn
    Acciones de comentarios Permalink

    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

    0
  • Catherine Michalak
    Acciones de comentarios Permalink

    robin van Doorn, I am not sure what that means, please share your solution / code if possible.

     

    Nicole - Community Manager, is there anyone that can help review if this solution is ok to copy? thanks!

    0
  • Nicole - Community Manager
    Acciones de comentarios Permalink

    HI Catherine - We can ask if any of the community moderators can review it. 

    0
  • Dan Cooper
    Acciones de comentarios Permalink

    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).

    0
  • robin van Doorn
    Acciones de comentarios Permalink

    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>

    0

Iniciar sesión para dejar un comentario.

Tecnología de Zendesk