Table of Content

Respondida

7 Comentários

  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Hi Enrique Paul

    Glad to hear that you read  my posts :)

    You can read my Tip for TOC also:

    https://support.zendesk.com/hc/en-us/community/posts/4408867942298-Tip-How-to-make-a-Table-Of-Contents-TOC-For-Article-Template

     

    And if any confusion feel free to ask.

    Thanks

    0
  • Enrique Paul

    Thankyou, that worked for me.
    I have one more query, how can I add external url to my table of content links?

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Enrique Paul,

    I have one more query, how can I add external url to my table of content links?

     

    Solution:

    $(document).ready(function() {
      $("#toc").toc({content:".article-body", headings:"h1,h2,h3,h4,h5,h6"});
      

     // External URL - Start
      $("#toc  li:first-child a").attr("href", "http://www.google.com/");
      $("#toc  li:nth-child(2) a").attr("href", "amazon.com");
      $("#toc  li:nth-child(3) a").attr("href", "yahoo.com/");
      // End
    });

     

    But, why do you wanna external URL in TOC items? :)

     

     

     

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    Do you wanna link accordion panel-body  to TOC items, am I right? :)

    0
  • Enrique Paul

    Thanks and yes you guess that right.😊

    0
  • Enrique Paul

    I am adding my HTML code and this is not working. Why?

    0
  • Ifra Saqlain
    Community Moderator
    Most Engaged Community Member - 2022
    Most Engaged Community Member of The Year - 2021

    For article's source code:-

    Check the box  'Display unsafe content' in the Guide setting > Security section.

     

    By the way, HTML always works but you can try this option if uncheck the box in your Guide settings.

     

    If issue is not which I mentioned then share complete query.

    0

Por favor, entrar para comentar.

Powered by Zendesk