返信テンプレート

||||\n-|-|-|\n:discourse2: | 概要 | Reply Templateを使用すると、投稿の一部を返信や新しいトピックで簡単に再利用できます。\n| :eyeglasses: | プレビュー | Discourse Theme Creatorでプレビュー\n:hammer_and_wrench: | リポジトリリンク | \u003chttps://github.com/discourse/discourse-reply-template-component\u003e\n:open_book: |Discourseテーマは初めてですか? | Discourseテーマ使用のための初心者ガイド\n\n[wrap=theme-install-button repoUrl="https://github.com/discourse/discourse-reply-template-component\" repoName="Discourse Reply Template"]\nこのテーマコンポーネントをインストール\n[/wrap]\n[quote]\n\n:discourse2: これはDiscourseチームによって保守されている#officialテーマコンポーネントであるため、#support、#bug、#ux、および#featureのリクエストは、ここMetaのそれぞれのカテゴリで行い、適切なテーマコンポーネントタグを付けてください。開始するには、以下のリンクのいずれかをクリックしてください。 :+1: \n\n\u003ckbd\u003e [:question:\u0026nbsp;サポート](Discourse Meta "Reply Templateの設定と使用に関するサポートを求める") \u003c/kbd\u003e \u003ckbd\u003e [:bug:\u0026nbsp;バグ](Discourse Meta "バグレポートは、テーマコンポーネントの通常/典型的な使用を妨げる何かが壊れていることを意味します") \u003c/kbd\u003e \u003ckbd\u003e [:eyes:\u0026nbsp;UX](Discourse Meta "Reply Templateのユーザーインターフェース、および機能の表示方法(言語やUI要素を含む)に関するディスカッション") \u003c/kbd\u003e \u003ckbd\u003e [:bulb:\u0026nbsp;機能](Discourse Meta "既存のReply Template機能の改善や強化の方法、および提案された新しい機能の動作方法に関するディスカッション")\u003c/kbd\u003e\n\n[/quote]\n\n### 機能\n\n Reply Templateを使用すると、投稿の一部を返信や新しいトピックで簡単に再利用できます。\n\n### 使用方法\n\n\n[wrap=template key=\"template-name\"]\n再利用可能なコンテンツ\n\n- [ ] タスク 1\n- [ ] タスク 2\n[/wrap]\n\n\nログインしていないユーザーがボタンをクリックすると、ログインモーダルが表示されることに注意してください。\n\nkey は必須です\n\n### その他のオプション\n\n- action=\"create\" これにより、ボタンが新しいトピックを作成するためのコンポーザーを開きます\n- action=\"create_pm\" これにより、ボタンが新しいプライベートメッセージを作成するためのコンポーザーを開きます\n- categoryId=\"2\" action=\"create\"でのみ使用可能で、開いたコンポーザーのカテゴリを設定します\n- title=\"some title\" createおよびcreate_pmでのみ使用可能で、トピック/PMのタイトルを設定します\n- recipients=\"a@example.com\" create_pmでのみ使用可能で、送信先の人々\n- usernames=sam create_pmでのみ使用可能\n- label=\"My button text\" ボタンのテキスト\n\n\n### プレースホルダー\n\nテンプレート内に特殊なキーを配置すると、それらが置き換えられます。\n\n- \$week_start -\u003e 週の始まりの日付\n- \$week_end -\u003e 週の終わりの日付\n- \$prev_week_start -\u003e 前週の始まりの日付\n- \$prev_week_end -\u003e 前週の終わりの日付\n- \$today\n- \$tomorrow\n- \$username -\u003e 現在のユーザーのユーザー名\n- \$name -\u003e 現在のユーザーの名前 \n\nこれはローカルの日付に置き換えられることに注意してください。\n\n特殊なプレースホルダーはtitleにも補間されます\n\n### タグリスト\n\ntagsList=\":heart:,foo,#bar" は、テンプレートの最後にチェックボックスのリストを表示し、人々が投稿に簡単にタグを付けられるようにします。\n\n

\n\n## 例\n\n\n私のToDoリスト $week_end\n\n- [x] タスク 1\n- [x] タスク 2\n\n\n### 設定\n\n| 翻訳 | デフォルト\n|-|-|\n| discourse_reply_template_component.use_template_reply | テンプレートを返信として使用\n| discourse_reply_template_component.use_template_create | テンプレートを新しいトピックとして使用\n| discourse_reply_template_component.use_template_create_pm | テンプレートを新しいPMとして使用\n| discourse_reply_template_component.needs_key | 各テンプレートにはキー属性が必要です。例: [wrap=template key=\"weekly_status\"][/wrap]\n\n\u003cbr\u003e\n\n\u003e:discourse2: ホストされていますか? テーマコンポーネントは、Standard、Business、およびEnterpriseプランで利用できます。"

「いいね!」 43

I was wondering can this be used in a specific category/sub?

Ie bug reporting form?

「いいね!」 3

Yes :arrow_down:

E.g.
[wrap=template key="bug-report" action="create" categoryId="your-bug-category-id"]

「いいね!」 9

Thank you will need to explore this more.

This is the best. Thank you!! I use this to create checklist templates that can be created anytime we’re doing a repetitive project. Before, our instructions would have been “copy and paste everything below” instead of having this very elegant button to create a topic for people.

「いいね!」 5

Is there a plan to make this functionality accessible in the composer window? To me the most logical place being where things like Hide Details and Build Poll live.

「いいね!」 3

I just updated the component, see OP for usage but a quick note:

  • placeholder dates are now replaced by local dates
  • you can now define a tagsList

「いいね!」 8

Thank you for a great component!

It’s impossible to add a poll in the wrap. Can you add this functionality?

[wrap=template key="template-name"]

[poll type=regular results=on_vote chartType=bar]
# Who will join?
* 1
* 2
* 3
[/poll]

[/wrap]

I added more locales to your component and created a PR. Please, check.

「いいね!」 1

How can i install this component?

In my opinion it’d be more helpful to have an example for the reply case (without action=create) because this is probably the reason, the majority is searching for since creating a topic is already possible via URL

My try:

  • ok
  • fail
「いいね!」 2

Would it be possible to use a template to create a new personal message?

Also, when someone is not signed in, clicking on “Use template as reply” does not result in any action. Could you add functionality where if a user is not logged in, something happens to nudge them to log in or create a new account?

「いいね!」 4

Great suggestion, it’s done, I updated the OP.

「いいね!」 4

Is there a way to pre-populate the title of a new topic?

Is there a way to automatically add tags instead of having just the tag list?

「いいね!」 4

No, but that’s reasonable feature request for sure. I’m kinda full ATM but making a note of this, thanks.

「いいね!」 5

Is there any possible way to modify the stock reply button in a topic with such a template?
That would be a gamechanger for specific structured conversations in the forum. Especially for contests etc where users have to submit content in a structured manner.

「いいね!」 1

Hi, sorry I don’t understand your request, can you be more specific please ?

Currently the user can access the reply template only via the button in the first post generated by the theme component.
What I would like to achieve is to enable the template for the stock reply buttons in the topic as well (reply button below the timeline and reply button below the last post)

Edit: One prolific use case is a topic where users can leave feedback like bug reports etc. If we could add per-topic post templates just like for per-category templates for new topics, that would lead to less incomplete reports and hence save our staff a lot of time.

「いいね!」 5

こんにちは。

このコンポーネントのインストールに問題があります。Discourseは初めてなので、実行した手順が正しいか確認していただけると幸いです。

Installing a theme or theme component のガイドに従ってコンポーネントをインストールしました。すべてのテーマにコンポーネントを含めました。

しかし、新しいトピックを作成し、以下を含めると:

再利用可能なコンテンツ

  • タスク 1
  • タスク 2

「テンプレートを返信として使用」ボタンが表示されません。例:

テンプレートがそのまま表示されるだけです。何か手順を飛ばしてしまいましたか?コードでカスタマイズする必要があるものはありますか?

また、DiscourseはCSS、HTML、またはYAMLにエラーがあると表示しています。これがボタンが表示されない理由と関係があるのか分かりません。

何かお手伝いいただけると幸いです。

明日確認します

「いいね!」 2

ありがとうございます。実行しているDiscourseのバージョンに問題がある可能性もあると聞きましたが、その件については改めてご連絡します。