Display section names on article page

6 Comments

  • Comment actions Permalink

    Hi Meghan, in order to display Other Sections from the same category automatically, you need to create a script that uses Zendesk API. You can do it on your own, if you are familiar with this.

    We can also help you with this customization, but we don't customize standard themes or themes made by other developers. So it's important that you use one of our Zendesk themes

     

    Best, 

    Lotus Themes Team

    0
  • Customer Support Theme
    Comment actions Permalink

    Hello @Meghan Mahar,

    We have a plugin for you - http://customersupporttheme.com/zendesk-plugins/ (Zendesk Categories List with Sections)

    This plugin lists Categories and Sections automatically on your Help Center. It works on Category, Section, and Article Templates.

    Some of our recent clients using this plugin:

     - https://ajuda.umov.me/hc/pt-br/articles/115005535508-Cria%C3%A7%C3%A3o-de-dashboard-personalizado

      - https://support.smarter.am/hc/en-us/articles/115005162769-How-do-I-descale-my-Smarter-Coffee-machine-

    If have any question feel free to message us at - info@customersupporttheme.com

    Thanks
    Customer Support Team
    http://customersupporttheme.com
    (Experts in Zendesk Themes, Zendesk Help Center, Plugins, Help Center Branding and Customization.)

     

    0
  • Trapta
    Comment actions Permalink

    Hey @Meghan Mahar,

    Go to your article template and replace the code from line no. 8 with the code below,

    <div class="article-container" id="article-container">
    <section class="article-sidebar">
    <section class="section-articles collapsible-sidebar">
    <h3 class="collapsible-sidebar-title sidenav-title">{{t 'articles_in_section'}}</h3>
    <ul>
    {{#each section.articles}}
    <li>
    <a href="{{url}}" class="sidenav-item {{#is id ../article.id}}current-article{{/is}}">{{title}}</a>
    </li>
    {{/each}}
    </ul>
    {{#if section.more_articles}}
    <a href="{{section.url}}" class="article-sidebar-item">{{t 'see_more'}}</a>
    {{/if}}
    </section>
    <section id="sections-list" class="sections-list collapsible-sidebar">
    <h3 class="collapsible-sidebar-title sidenav-title">
    Other Sections
    </h3>
    </section>
    </section>

    <script>
    var catID = $('.breadcrumbs li:nth-child(2) a').attr('href').match(/[0-9]+/);

    $.getJSON('/api/v2/help_center/en-us/categories/'+catID+'/sections.json', function(data){
    //console.log(data.sections);
    var output = "";

    $.each(data.sections, function(idx, itm){
    output += '<li>';
    output += '<a href="'+itm.html_url+'">'+itm.name+'</a>';
    output += '</li>';
    });

    $('#sections-list').append('<ul>'+output+'</ul>')
    });
    </script>

    Let me know if you face any issue.

    Team Diziana

    0
  • Trapta
    Comment actions Permalink

    Credit for the above code goes to Vladan. He has posted the code here and I tweaked it a bit to make it work for you.

    Thanks

    0
  • Meghan Mahar
    Comment actions Permalink

    Thank you, Trapta (and Vladan wherever you are)! This worked great. Now to see if I can tweak the CSS of the list. Thanks again! 

    0
  • Amy Kember
    Comment actions Permalink

    @Trapta or @Meghan Mahar, any chance you could share how to tweak the CSS to match the "Articles in this section" list? Thanks!

    0

Please sign in to leave a comment.

Powered by Zendesk