Usando modelos de tópicos para categorias

:bookmark: This guide explains how to use topic templates in categories and explores alternative methods for structuring content in Discourse.

:person_raising_hand: Required user level: Administrator

Topic templates are powerful tools for maintaining forum consistency and guiding new users. This guide will walk you through setting up category topic templates and explore alternative methods for structuring content in Discourse.

Summary

  • Learn how to set up category topic templates
  • Discover alternatives like pre-filled topic links and reply templates
  • Understand how to use topics as templates for canned replies

Setting up category topic templates

Category topic templates are useful when you want topics in a specific category to follow a consistent format. Here’s how to set them up:

  1. Navigate to the desired category
  2. Click the :wrench: (wrench) button
  3. Find “Topic Template” in the left menu
  4. Enter your desired template in the text area

For example, a “Movies” category might use this template:

I saw: [insert movie title]

I think it was worth: [how many stars] out of 4 stars

Review here:

:information_source: You can add hidden comments to the template using HTML comments: <!-- I'm an HTML comment -->.

Alternatives to category topic templates

If category topic templates don’t quite fit your needs, consider these alternatives:

Creating pre-filled topic links

You can create URLs that, when clicked, open a new topic with pre-filled information:

  1. Use this URL structure:
    https://discourse.example.com/new-topic?title=topic%20title&body=topic%20body&category=category/subcategory
  2. Modify the parameters as needed

For more details, read the guide on creating new topic links with pre-filled information.

Using reply templates

For topics that require structured replies, consider using the Reply Template theme component:

  1. Install the Reply Template theme component
  2. Set up your desired reply template

Example template:

[wrap=template key="template-name"]
Task list for $tomorrow
- [ ] task 1
- [ ] Clean the <!-- FILL IN ROOM NAME: --> _
[/wrap]

Creating template topics for canned replies

The Discourse Templates plugin allows you to use entire topics as templates for canned replies:

  1. Install the Discourse Templates plugin
  2. Create one or more categories to store your templates
  3. Add topics to these categories, with the first post serving as the template

Additional resources

20 curtidas
Is there a way to make an input form for structured data?
How to add information while user creates post
How to optimize issue/support ticket like workflow?
Is it possible to have a questionnaire topic?
Can I add new fields to a topic?
Replies with specified fields
Using Discourse as a personal Journal?
Optimized interface for mass editing topic titles?
How to hide placeholder from message composer
Topic template is confusing on mobile
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?
Forms on Discourse
Custom Topic Fields
Can I customize the welcome message shown when creating a new topic based on the chosen tag or category?
Alerts that react to the user
Discourse Workflow
Use URL to compose a new message, with `body` adding new lines
Replace "+ New Topic" with "+ Create Event" option
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
Thoughts from the Elm community on Intentional Communication
Are the tables on top of some posts markdown or a feature?
Discourse/jobs?
Custom post warning for categories
Sending a message upon post
Topic template is confusing on mobile

Talvez form-templates também possa ser mencionado.

Este modelo de tópico básico suporta um placeholder para o nome de usuário do pôster? Semelhante ao que o discourse-templates faz.

1 curtida

Oi, eu criei um modelo para uma das minhas categorias, mas ele não é usado quando os usuários criam um novo tópico, por quê? Obrigado.

Parece que esse componente estava impedindo a exibição dos modelos: “Texto de Espaço Reservado do Modelo de Tópico”

Desativei esse componente e agora meus modelos funcionam.

2 curtidas

Eu sugeriria adicionar a tag topic-templates.