display FAQ section on

5 댓글

  • Matteo
    Zendesk Community Team

    Hello Sam,

    I believe this is possible using the section_tree_with_article.

    If that does not provide the desired results, you could also use category_tree_with_article, that will provide you with the id, and name of the sections. From there, you can populate them in the home page by applying your own logic in your code.

    Let us know if you have other questions!

    0
  • Sam

    Hello Matteo,

    firstly apologies for in the incomplete title of my post is should have included 'home page'

    That being said with your advice I have managed to do what I wanted. Accept I found I could not use section_tree_with_article on the home page? Please let me know if you think this is wrong. Anyway the code I used may be able to be shortened?  See below

    Thanks again for your help!

    {{#if category_tree_with_article}}
     {{#each categories}}
      {{#is id 360000011375}}
       {{#each sections}}
        {{#is id 360000022895}}
        <h3>{{name}}</h3>
        <ul class="faqs">
         {{#each articles}}
          <li><a href="{{url}}">{{title}}</a></li>
         {{/each}}
       </ul>
       {{/is}}
      {{/each}}
     {{/is}}
     {{/each}}
    {{/if}}

    0
  • Matteo
    Zendesk Community Team

    Hello Sam,

    I'm glad to see my suggestion helped.

    The category_tree_with_article can work on the home page. If that is not the case, the issue might be located elsewhere in your codebase.

    That being said, I do want to set the expectation that we are rather limited on what we can assist with in regards to custom code at Zendesk.

    Hopefully some of our community members can jump in and offer up some advice!

    Let us know if you have any other questions!

    0
  • Trapta
    Community Moderator

    Hi @Sam,

    category_tree_with_article is a single line component i.e., you cannot use if condition with it. Try using the below code:

    {{#each categories}}
    {{#each sections}}
    {{#is id 360000022895}}
    <h3>{{name}}</h3>
    <ul class="faqs">
    {{#each articles}}
    <li>
    <a href="{{url}}">{{title}}</a>
    </li>
    {{/each}}
    </ul>
    {{/is}}
    {{/each}}
    {{/each}}

    Let us know if this solves your issue.

    Team Diziana

    0
  • Sam

    @Trapta

    thanks for this information!, we have gone down a different path now (using promoted articles) but this handy information

    Sam

    0

댓글을 남기려면 로그인하세요.

Zendesk 제공