カテゴリ用のトピックテンプレートの使用

:bookmark: このガイドでは、カテゴリでトピックテンプレートを使用する方法と、Discourseでコンテンツを構造化するための代替方法について説明します。

:person_raising_hand: 必要なユーザーレベル: 管理者

トピックテンプレートは、フォーラムの一貫性を維持し、新しいユーザーを導くための強力なツールです。このガイドでは、カテゴリトピックテンプレートの設定方法を説明し、Discourseでコンテンツを構造化するための代替方法を探ります。

要約

  • カテゴリトピックテンプレートの設定方法を学習する
  • 事前入力されたトピックリンクや返信テンプレートなどの代替手段を発見する
  • トピックを定型文返信のテンプレートとして使用する方法を理解する

カテゴリトピックテンプレートの設定

特定のカテゴリ内のトピックが一定の形式に従うようにしたい場合に、カテゴリトピックテンプレートは役立ちます。設定方法は次のとおりです。

  1. 対象のカテゴリに移動します
  2. :wrench: (レンチ)ボタンをクリックします
  3. 左側のメニューで「トピックテンプレート」を見つけます
  4. テキストエリアに目的のテンプレートを入力します

たとえば、「映画」カテゴリでは次のテンプレートを使用できます。

鑑賞した作品: [映画のタイトルを挿入]

評価: 4つ星中[星の数を挿入]
 
レビューはこちら:

:information_source: HTMLコメントを使用してテンプレートに非表示のコメントを追加できます: <!-- HTMLコメントです -->

:bulb: トピックテンプレートタブには、トピックタイトルのプレースホルダーフィールドもあります。これにより、ユーザーがそのカテゴリで新しいトピックを作成したときにトピックタイトルフィールドに表示されるプレースホルダーテキストを設定でき、使用するタイトル形式のガイドになります。

カテゴリトピックテンプレートの代替案

カテゴリトピックテンプレートがニーズに完全には合わない場合は、次の代替案を検討してください。

事前入力されたトピックリンクの作成

クリックすると、事前入力された情報を含む新しいトピックが開くURLを作成できます。

  1. 次のURL構造を使用します。
    https://discourse.example.com/new-topic?title=topic%20title&body=topic%20body&category=category/subcategory
  2. 必要に応じてパラメーターを変更します

詳細については、事前入力された情報を含む新しいトピックリンクの作成方法に関するガイドをお読みください。

返信テンプレートの使用

構造化された返信が必要なトピックの場合は、返信テンプレートのテーマコンポーネントの使用を検討してください。

  1. 返信テンプレートのテーマコンポーネントをインストールします
  2. 目的の返信テンプレートを設定します

テンプレートの例:

[wrap=template key="template-name"]
$tomorrow のタスクリスト
- [ ] タスク 1
- [ ] 掃除する <!-- 部屋の名前を入力: --> _
[/wrap]

定型文返信のためのテンプレートトピックの作成

Discourse Templatesプラグインを使用すると、トピック全体を定型文返信のテンプレートとして使用できます。

  1. Discourse Templates プラグインをインストールします
  2. テンプレートを保存するための1つ以上のカテゴリを作成します
  3. これらのカテゴリにトピックを追加し、最初の投稿をテンプレートとして使用します

その他のリソース

「いいね!」 20
Is there a way to make an input form for structured data?
How to add information while user creates post
Is it possible to have a questionnaire topic?
How to optimize issue/support ticket like workflow?
Can I add new fields to a topic?
Replies with specified fields
Using Discourse as a personal Journal?
Custom Topic Fields
How to hide placeholder from message composer
Optimized interface for mass editing topic titles?
Feature request: duplicate posts
Building a practitioner directory or category in a community
Plugin to gather approvals / signatures on an initiative?
How to include the label/text on the post creation textbox?
Auto-Populating Category Topic Templates with Usernames
Does this platform not give users templates when creating posts?
Creating form templates
Reply Template
Custom topic fields per category or custom topic entry form per category?
How can I set up a reminder banner in the editor?
Structuring an active support community migrating from Facebook
Discourse/jobs?
Thoughts from the Elm community on Intentional Communication
Replace "+ New Topic" with "+ Create Event" option
Use URL to compose a new message, with `body` adding new lines
Alerts that react to the user
Can I customize the welcome message shown when creating a new topic based on the chosen tag or category?
Forms on Discourse
Are the tables on top of some posts markdown or a feature?
Custom post warning for categories
Sending a message upon post
Topic template is confusing on mobile
Topic template is confusing on mobile

#form-templatesについても言及できるかもしれません。

この基本的なトピックテンプレートは、投稿者のユーザー名のプレースホルダーをサポートしていますか? discourse-templates のようなものです。

「いいね!」 1

こんにちは、私のカテゴリーのテンプレートを作成しましたが、ユーザーが新しいトピックを作成するときにそれが使われません。なぜでしょうか?ありがとうございます。

それは、そのコンポーネントがテンプレートの表示を妨げているようです:「Topic Template Placeholder Text」

そのコンポーネントを無効にしたところ、私のテンプレートは正常に動作しています。

「いいね!」 2

topic-templates タグを追加することをお勧めします。

「いいね!」 1