Display 2 levels of sub-sections on the section page

Respondida

6 Comentários

  • Kay
    Community Moderator

    Hi Robert 👋

    Yes this is possible since you are on the Enterprise plan.
    You have access to use the Section Object in the Section page

    {{#if section.articles}}
      <ul class="article-list">
        {{#each section.articles}}
          <li class="article">
            <a href="{{url}}">{{title}}</a>
          </li>
        {{/each}}
      </ul>
    {{else}}
      <i class="section-empty">
        <a href="{{section.url}}">{{t 'empty'}}</a>
      </i>
    {{/if}}
    {{#if sections}}
    <ul class="section-list">
    {{#each sections}}
    <li class="section">
    <a href="{{url}}">{{name}}</a>
    </li>
    {{/each}}
    </ul>
    {{else}}
    <i class="section-empty">
    <a href="{{url}}">{{t 'empty'}}</a>
    </i>
    {{/if}}

    1
  • Robert Klapwyk

    Kay,

    Thanks for the response. The code you posted for the section_page.hbs will display the following:

    Sub-Section 1

    • Article 1
    • Article 2

    However, we would like to display the sections under a sub-section, like:

    Sub-Section 2

        Sub-Sub-Section 1
        Sub-Sub-Section 2

    However, it will not display the "Sub-Sub-Section..."'s

     

    0
  • Kay
    Community Moderator

    Robert,

    Please check out the second part of the code.
    It does exactly that.

    Edit: I see what you mean, sorry for misunderstanding on my end. It is limited to only direct child sections.

    - Kay

    0
  • Robert Klapwyk

    When I attempt to nest the each... I get the error "not possible to access `section` in `section.sections`"

        {{#each section.sections}}
    <li class="section">
    <a href="{{url}}">{{title}}</a>
    </li>
    {{#each section.sections}}
    <li class="section">
    <a href="{{url}}">{{title}}</a>
    </li>
     {{/each}}
    {{/each}}


    0
  • Sarissa Sanderson

    So is there just no way to do this? We have the same scenario - on the section page (not the category page) we have subsections that only contain further subsections and no articles directly under them. We want those sub-subsections to list under the subsections header but can't figure out how to show them. Did someone figure out how to do it?

    0
  • Cheeny Aban
    Zendesk Customer Advocate

    Hi Sarissa!

    We understand your need for this functionality and we marked this conversation as product feedback for review, which means that your input will be aggregated as a part of our Voice of the Customer program that provides customer feedback to our product development teams.

    In addition, I encourage you to create a new post in the Guide Product Feedback topic in our community to engage with other users who have similar needs and discuss possible workarounds. Conversations with a high level of engagement ultimately get flagged for product managers to review when they go through roadmap planning.

    Specific examples, details about impact, and how you currently handle things are helpful for our product teams to understand the full scope of the need when working on solutions. You may also want to review the Product feedback guidelines and how to write an effective feedback post.

    We truly value customer feedback and your voice and votes in the forums help influence future Zendesk functionality.

    0

Por favor, entrar para comentar.

Powered by Zendesk