Show section.name in Article page

2 Comments

  • Tal Admon

    Hi Veronica,

    Unfortunately, in the Article page, you only have the Breadcrumbs helper available to you to get the section name:
    https://developer.zendesk.com/apps/docs/help-center-templates/article_page

    So, you can add the following script in the Article page (I added it below the actual breadcrumbs).

    It will re-render the breadcrumbs to show only the section link.

    You can edit the CSS as you want, but it is important to have it not displayed when the page first renders to avoid flickering.
    The JS code will take care of showing this section when it's ready.

    1.

    In the Article page:

    <nav class="section_name__c">
    {{breadcrumbs}}
    </nav>
    <script>
    $(document).ready(function(){
    sectionName = $('.section_name__c a[href*="/sections/"]');
    $('.section_name__c').html(sectionName);
    $('.section_name__c').show();
    })
    </script>

    2.

    In the CSS:

    .section_name__c {
    display:none;
    }

     

     

    1
  • Verónica García

    Hi Tal,

    This worked wonderful!

    Thanks!!!

    0

Please sign in to leave a comment.

Powered by Zendesk