Discourse now supports composing a new (pre-filled) topic via URL! To compose a new pre-filled topic, modify URL params like this:
https://discourse.example.com/new-topic?title=topic%20title&body=topic%20body&category=category/subcategory&tags=email,planned
This will open composer window pre filled with topic title, body, category and tags.
Breaking down the link / URL to show the available options, we have:
- the base URL / link:
https://discourse.example.com/new-topic
- the
?
URL operator to add the different options - the topic title:
title=topic%20title
- the
&
URL operator to include multiple options - the body of the topic:
body=topic%20body
- the
&
URL operator again to include multiple options - the category and subcategory separated by a slash
/
if you want to include them:category=category/subcategory
- the
&
URL operator again to include multiple options - and the tags separated by comma(s)
,
if you want to include multiple tags:tags=email,planned
Try it out live, here on meta!
Also, instead of providing category/subcategory name, you can also specify a numeric category_id
, like:
This feature also supports “Start a topic by pasting a link (like Reddit)”, provided that the body is not present.
The URL must be URL encoded for the link to work.
For example, to create a topic with the following URL https://www.xkcd.com/556
, the link will be:
https://meta.discourse.org/new-topic?title=https%3A%2F%2Fwww.xkcd.com%2F556
In general, if you have a lot of text to add, you can use w3Schools’s HTML URL Encoding Reference to find what text characters are encoded as in the URL, there is a text to URL converter in the Try It Yourself
section in the page linked above in this paragraph.
Want to create / compose a new pre-filled personal message instead? See: Create a link to start a new personal message with pre-filled information