最近の検索


最近の検索はありません

How to include subsections in custom section template

回答済み


投稿日時:2023年3月07日

Our help center is organized into a few layers of subsections. We're trying to create a custom section template that loops over the sections and then also loops over subsections to list out the articles within.

We created a new section template and applied that to the section that we're attempting to do this with.

Inside the template itself, we've got the following:

{{#if section.sections}}
{{#each section.sections}}
  <div>
    <h2>{{name}}</h2>
    <div>
      {{#if sections }}
{{#each sections}}
<div>{{name}}</div>
{{/each}}
{{/if}}
</div>
</div>
{{/each}}
{{/if}}

The idea is that we loop over each of the sections and the sections within each of those to simply render the name, but the editor is throwing the following error:


According to the documentation, section objects should contain an array of sections, so from that understanding, you should be able to loop over nested subsections as many times as you want:

https://developer.zendesk.com/documentation/help_center/help-center-templates/objects/#section-object

Either the syntax is wrong or that's not possible, though, so does anyone have any idea if we can actually render subsections within a template? 

I've also tried `section.sections` in the second each loop as well.

I've seen this:

https://support.zendesk.com/hc/en-us/articles/4408883063066-Displaying-subsections-in-your-help-center#topic_j3b_vgs_jhb

But it doesn't seem exactly the same and it is also for a different theme. We're using Braden not Copenhagen.


0

1

1件のコメント

サインインしてコメントを残してください。

お探しのものが見つかりませんか?

新規投稿