質問
記事またはセクションを複数のセクションまたはカテゴリに表示することはできますか?
回答
免責事項:この記事は説明のみを目的として提供されています。記事内で例示したコードについて、Zendeskはサポートも保証もいたしません。何か問題があった場合はコメントセクションに投稿するか、インターネットで解決策を探してみてください。
ヘルプセンターでは、コンテンツは「ホーム」>「カテゴリ」>「セクション」>「記事」の構造で構成されています。デフォルトの機能では、セクションは1つのカテゴリにしか含めることができず、記事は1つのセクションにしか含めることができません。
ただし、セクションまたはカテゴリのテンプレートをカスタマイズして、利用可能にしたいページ内にセクションまたは記事へのリンクを表示することができます。コードのis
プロパティを使用して、追加のセクションまたはカテゴリにコンテンツを表示します。
これを行うには、セクションまたはカテゴリのIDが必要です。URLの最後にあるセクションIDまたはカテゴリIDを見つけます。例えば、次の記事がカテゴリ(https://support.zendesk.com/hc/en-us/categories/4405298745754
)に公開されたとします。カテゴリIDは「4405298745754
」です。
この記事では、次のセクションについて説明します。
セクションに記事を追加する
セクションに記事を追加するには
- Guideで、「Guideの管理者」を選択します。
- サイドバーにある「デザインをカスタマイズ」アイコン(
)をクリックします。
- 変更したいテーマを開き、「カスタマイズ」をクリックします。
- 「コードを編集」をクリックします。
- テンプレートエディタで、「ファイル」の下にある「section_page.hbs」を開きます。
-
{{#if section.articles}}
ヘルパーに属する、
要素の下にコードを配置します。
{{#is section.id ######}}
<a href="article URL without the text slug">Title of the article</a>
{{/is}} - 「公開」をクリックします。
カテゴリにセクションを追加する
カテゴリにセクションを追加するには
- Guideで、「Guideの管理者」を選択します。
- サイドバーにある「デザインをカスタマイズ」アイコン(
)をクリックします。
- 変更したいテーマを開き、「カスタマイズ」をクリックします。
- 「コードを編集」をクリックします。
- テンプレートエディタで、「ファイル」の下にある「section_page.hbs」を開きます。
- コードをの下に配置します。
{{#is category.id ######}}
<a href="section URL without the text slug">Title of the section</a>
{{/is}} 「公開」をクリックします。
カテゴリに記事を追加する
{{#each section}}ヘルパー内のカテゴリページに記事を追加するには
- Guideで、「Guideの管理者」を選択します。
- サイドバーにある「デザインをカスタマイズ」アイコン(
)をクリックします。
- 変更したいテーマを開き、「カスタマイズ」をクリックします。
- 「コードを編集」をクリックします。
- テンプレートエディタで、「ファイル」の下にある「section_page.hbs」を開きます。
- コードを
{{#each sections}}
ヘルパーの下に配置します。
{{#is id ######}}
<a href="article URL without the text slug">Title of the article</a>
{{/is}}
- 「公開」をクリックします。
記事を空のセクションに追加する
記事を空のセクションに追加するには
記事を空のセクションに追加する場合、ワークフローが異なります。それは、セクションで空のリンクを表示するelse
/if
ステートメントをコードが取り込むためです。
- Guideで、「Guideの管理者」を選択します。
- サイドバーにある「デザインをカスタマイズ」アイコン(
)をクリックします。
- 変更したいテーマを開き、「カスタマイズ」をクリックします。
- 「コードを編集」をクリックします。
- テンプレートエディタで、「ファイル」の下にある「section_page.hbs」を開きます。
-
{{else}}
から{{/if}}
に移動するコードを.以下のコードに置き換えます。
{{else}}
{{#is section.id ######}}
<ul class="article-list">
<li class="article-list-item">
<a href="article URL without the text slug">Title of the article</a>
</li>
</ul>
{{else}}
<i class="section-empty">
<a href="{{section.url}}">{{t 'empty'}}</a>
</i>
{{/is}}
{{/if}}
- 「公開」をクリックします。
セクションを空のカテゴリに追加する
セクションを空のカテゴリに追加するには
記事を空のカテゴリに追加する場合、ワークフローが異なります。それは、カテゴリで空のリンクを表示するelse
/if
ステートメントをコードが取り込むためです。
- Guideで、「Guideの管理者」を選択します。
- サイドバーにある「デザインをカスタマイズ」アイコン(
)をクリックします。
- 変更したいテーマを開き、「カスタマイズ」をクリックします。
- 「コードを編集」をクリックします。
- テンプレートエディタで、「ファイル」の下にある「section_page.hbs」を開きます。
-
{{else}}
から{{/i}}
に移動するコードを.以下のコードに置き換えます。
{{else}}
{{#is category.id ######}}
<section class="section">
<h3 class="section-tree-title">
<a href="section URL without the text slug">Title of the section</a>
</h3>
</section>
{{else}}
<i class="category-empty">
<a href="{{category.url}}">{{t 'empty'}}</a>
</i>
{{/is}}
- 「公開」をクリックします。
42件のコメント
Connie Farrell
Hi all,
Is there a code based solution that would allow us to display these links depending on the article's publication status? The problem I'm running into is even if the article is unpublished, we're still displaying this link in the section designated by the section ID in the code.
0
Joyce
Are you looking to translate the article title and content into different languages? If so, you can add a translated version of your article based on the languages enabled on your Help Center page.
You can visit the article Localizing help center content for more information.
0
Cristina Galera Molina
What about languages? How to add the title of the article so that it can be shown in the user's selected language in our Guide?
0
Cristina Galera Molina
What about languages? How to add the title of the article so that it can be shown in the user's selected language in our Guide?
0
Nicole Saunders
Hi all,
Here's the official feature request thread for this functionality:
Allow articles to be posted to multiple sections
This is where the product team will continue to provide updates on the request's status, so I encourage you to follow there.
0
Paul Dandurand
Dear Zendesk Product Manager,
This is such a common request from your user base. I wonder why you require folks to set up custom code instead of Zendesk just adding an alias for articles to be located in multiple places within your structure. I'm guessing it can't be hard to build.
The following is one idea of a draft requirement for this suggested Zendesk feature to help you think through it. Maybe it's more complex than I see it, and if so, I apologize for not knowing. :)
2
Thanursan
Since no one seems to have posted an example of multiple such articles in a section, here's an example:

Also the Zendesk Team can update the article to include:
'Wrapping' each article. This will ensure the article list formatting remains the same.

This is how it looks like:
1
Duygu Gözen
I have the same question as the one above. We have multiple languages how can we adjust this code to support different languages?
0
Umaima Munir
Hello, everyone!
Has anyone tried using the "Help Center Manager" app. by "Swifteq" for arranging and moving articles on the Guide - Help Center page?
0
Christine
You may want to check out the following articles that might help:
Thanks,
Christine
0
サインインしてコメントを残してください。