Topic-specific reply template

I’ve seen the topic templates (to guide someone creating a topic) and canned replies (to provide staff with a list of canned replies), but I haven’t spotted a way to do a topic-specific reply template in Discourse.


Users can include text in their topic that Discourse will use as the default content in the composer for replies to the topic.

The problem

In our forum, we sometimes have topics like:

  • “Propose ideas for the hackathon”
  • “Propose sessions for the unconference”
  • “Submit agenda items for a design call”

These requests generally include instructions on details to include when replying within the topic. The particular details are specific to the individual topic. We have an upcoming conference, so I’m seeing several of these types of posts lately, including people frequently overlooking the requested format/details in their replies.

While we will undoubtedly continue to make topics like this, instructing people on details to include in their responses, it would be cool if there was a way to include these instructions in a format that Discourse would recognize and turn into a template for responses (i.e., use as default text in the composer for replies in the topic).

Proposed Solution

If you are soliciting ideas from the community and need some details included in replies, you could create a topic like this:

Propose ideas for unconference sessions

I hope everyone is excited about our upcoming conference. We’ll, once again, be doing this as
an unconference. Please respond with your suggestion for a topic. If you see topics you like, favorite
them (click the heart) to register your interest. If you want to discuss a particular topic, please use the
new topic feature to move the discussion to a new topic. Please include the following details in your reply:

Title: provide a short title for the session here
Description: enter details about the session here
Suggested facilitators: name one or more people who could help facilitate

The template tags would be hidden in rendering and anyone replying to the topic within Discourse would have the following text in the composer by default:

**Title**: provide a short title for the session here
**Description**: enter details about the session here
**Suggested facilitators**: name one or more people who could help facilitate

Proposed approach

Place a hook on the reply to topic buttons (i.e., reply button on original post or reply button at the end of the discussion) and, when it is clicked, scan the topic for a [template][/template]. If found, pre-fill the compose with its contents (perhaps similar to how the Compose a new pre-filled topic via URL feature works… but for a reply to the current topic).

This approach would have the benefit that the reply template would only be used when a user is replying to the original post, avoiding the template when someone is replying to a subsequent post within the topic (where they likely wouldn’t want the template anyway).

Is there a feature similar to this already that I’ve overlooked? If not, I suppose this is more of a plugin request.


You can already do this at a Category level with Topic Templates.

What I need is a way to do this with PMs.


Thanks for the tip. I saw topic templates can be created for categories, but I’m looking for a way to provide a template for replies to a topic, not the topic itself. And we don’t want to create a new category for each discussion that might benefit from assisting people in the format of their replies.


wish the reply template too. I don’t want to add a new topic always


Maybe what you want is Compose a new pre-filled topic via URL for a reply rather than a topic. It’d require you to generate the URL, which is a bit fiddly, but it might not be too bad. What do you think, @techAPJ?


I am not sure “Compose a new pre-filled topic via URL” for replies is a good idea. If a user wants to reply to a topic, they just click on reply button, asking them to visit a new URL for replying does not feel intuitive IMO.


Thanks for the suggestion; however, I believe that feature is – by definition – used to create a new topic and not a reply. In fact, it’s the Compose a new pre-filled topic via URL feature that inspired this feature request – i.e., if we can pre-fill the composer for a new topic, then perhaps we could do it for a reply to a topic.

I would imagine the Reply Template feature would be implemented as a hook on the reply button. When a user hits a reply to topic (i.e., not a reply to post) button, it would scan the topic for a [template][/template] element and, if found, would pre-fill the composer with its contents.


I am very interested in having a reply template, too. Has anyone figured a way to do this?


I haven’t found a way to create reply templates in Discourse. Maybe we can band together and propose this as a GSoC project.* :slight_smile:

I’m guessing it could be done as a plugin. I’m not sure it would be a priority for Discourse or big enough of a project for GSoC. If not, maybe we could convince a promising GSoC candidate to whip up a reply template plugin as a part of their application for GSoC with Discourse (y’know, to impress @codinghorror). :wink:

*I’m assuming Discourse will be participating in GSoC again this year.


I’ve been reading through this topic:

Maybe a canned reply might work if it was for all users and can be edited once selected. . .

It’s a good thought; however, my use case is for the posts that come up fairly frequently in the OpenMRS forum, where someone is asking for details in responses that are specific to the individual post (so, not a good fit for canned responses).

Some examples that have come up recently:

Please share your ideas for potential GSoC projects. Please be sure to include title, description, mentor(s), skills needed, and a list of deliverables.

We’re gathering topics for our upcoming unconference. Please include title, description, objectives, and proposed facilitator(s).

If you would like to propose a design forum topic, please reply below. Be sure to include topic, a brief description, required attendee(s), goals for the discussion, and links to any pertinent materials.

In each case, the person posting is asking people to include specific details in their replies. You could liken it to a request for people to complete a form (but we all know filling out a form is much lamer than simply replying in Discourse). You could also liken it to the template used in issue trackers (what information to include about a bug); however, in these cases, the details being requested are specific to the question and may never come up again.


I imagine your canned reply would include the specs required with space under each spec for the user to fill in? e.g.
Canned Reply:




Skills needed:

List of deliverables:

Of course, this only works if the canned reply is editable after selected.

From what I understand you can add as many canned replies as you want.

Perhaps you could title each canned reply with a particular name and say in your topic, Select Canned Reply “X” to access template for reply…?

It might be better than nothing, but I don’t see this as a replacement for my proposed approach for two key reasons:

  1. Lack of support for ad hoc reply templates. The person writing the post needs to know the list of available reply templates and their specific contents to use them effectively. If there isn’t a perfect match, then you could easily end up with “please selected Canned Reply “X” and also include your name and contact information.”

  2. For simple templates, not much better than asking people to follow a template (what we’re doing now). While canned reply templates might be helpful for complex templates, that’s not really my use case. I’m looking for the simpler “be sure to include A, B, and C” use case. In these cases, we’re trying to spoon feed people the template by automatically pre-populating the composer. If the person replying has to scan a list of canned reply templates and select the correct one, we’re just replacing “be sure to include A, B, and C” with “be sure to pick the reply template that includes A, B, and C so you’ll be encouraged to include A, B, and C in your reply.” The second law of thermodynamics (i.e., entropy always wins) makes me believe people will either forego the canned reply selection step or pick the wrong one. :slight_smile:

Also, I’m not excited to have one more thing to manage within Discourse. Instead of a list of canned replies to manage, I’d rather let people make their own reply template on the fly: exactly like they want it, exactly when they need it.

In the end, there are probably use cases where canned replies would make more sense (so, maybe both features could be useful). But, for the reasons above, I think, for my use case, canned reply templates wouldn’t be a satisfactory alternative to topic-specific reply templates.


That makes sense, Burke. If I come across anything that looks like it might be useful for what you need, I’ll be sure to drop you a line.

@McBlu looks like you need to collect a bunch of data from your users in a more structure way.

Discourse is, at heart, a free form text platform.

Maybe oneboxing a proper form would work better for you?


I ended up just adding a form reply for every reply by following the steps here:

Is there a way to create template replies like there are templates for generating topics? support

I’d like a template to appear for replies. Is there a way to do that? Solved by @lll and @HAWK. Thank you!

However, that being said, when I get time I am going to look into your suggestion. I’m betting it could come in handy.

Thanks, @Falco


Try using this theme component to provide a reply template:


Thanks for the tip @riking. Glancing at that repo, it looks like it provides a “Use template as reply” button to expand week & previous week start & end templates. I don’t think that applies to this feature request.

The feature request is to allow some (hidden) text in a topic post that will automatically populate composer with a default value when people are replying within that specific topic. When requesting ideas, conference session topics, etc., it’s helpful to promote some consistency in the way people respond by using an ad-hoc template.

This feature already exists per category, so for now make sure the topics are in the specified category.

As I understand this feature request, it’s basically merging the functionality of the discourse-reply-template-component theme component that @riking mentioned above, with the “automatically filled editor” per-category feature of Topic Templates that @codinghorror mentions. I agree that there are many cases where you want to standardize reply format, and if these two concepts could fuse together somehow, then I think the use case will be realized.

1 Like