What are Topic Templates?


(Erlend Sogge Heggen) #1

Topic templates are a useful tool to reinforce forum conventions or to guide new users.

Category-specific topic template

Some categories might follow a strict pattern. One such example would be a Movies category, wherein you’d like users to start new topics according to a certain template:

I saw: insert movie title

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

Review here:

To apply this template to all new topics posted in this category, go to a category, click “Edit” and find “Topic Template” in the top menu.

You can see a live example of this if you register on our Try sandbox forum and post a new topic to the Movies category.

Pre-fill topic by URL

It’s also possible to create URL that, when clicked, will open a pre-filled topic. To compose a new pre-filled topic, modify URL params like this:

http://discourse.example.com/new-topic?title=topic%20title&body=topic%20body&category=category/subcategory

This will open composer window pre filled with topic title, body and desired category.

This can also be tested live on try.discourse.org:

Also, instead of providing category/subcategory name, you can also specify category_id, like:

Note that if both category_id and category is passed as param then priority is given to category_id.


Is there a way to make an input form for structured data?
How to optimize issue/support ticket like workflow?
Discourse - What do admins see on the Analytics dashboard?
Replies with specified fields
Thoughts from the Elm community on Intentional Communication
How to add information while user creates post
Optimized interface for "adapting" topic titles?
How to hide placeholder from message composer
(Michael Downey) #2

(Moderators, feel free to move this to a new topic if it’s not appropriate here.)

Question:
Is it possible to create a new pre-filled message by pre-filled URL just like shown above for new topics? (Perhaps a message to a Discourse group, for example.)


Topic template for uncategorized does not work
(Lisa Wess) #3

Can this be used for autopopulating tags? ie new-topic?tag=php or some such?


(Erlend Sogge Heggen) #4

Nope. Good idea though. I guess the syntax could be like this?

https://meta.discourse.org/new-message?title=topic%20title&body=topic%20body&recipient=erlend_sh/downey

Not yet, but I’m just as hopeful as you are :smiley: