xian, new to the forum, seeks a way to automatically create a new topic when a search yields no results, using the search term as the topic title. tvavrda explains that while Discourse doesn’t natively support this, it’s possible to dynamically generate topic creation links using URL parameters. These parameters can pre-fill the topic title, body, category (by name or ID), and tags. For example: https://your-discourse-instance.com/new-topic?title=Topic%20Title&body=Content&category=category/subcategory&tags=tag1,tag2. All text must be URL-encoded. This feature works only for logged-in users. For a fully automated Wikipedia-style “red link” system, custom development would be required. tvavrda also references a prior ask.discourse.com discussion on the topic and notes that embedded comment systems offer similar functionality.
Hello,
I’m new to this forum and looking for help.
I could not find a solution to my specific problem.
I want to be able to add a topic / thread in discourse with a press of a button if it is not found by the search. The name of the topic should be the search term.
Is there something like this already or how would I do that?
I thought about that too in order to make something Wikipedia has. So I asked and it seems to me there would be a way, maybe with a little theme that would convert the links leading nowhere to that:
Discourse allows you to create a topic dynamically by constructing a specific URL with parameters. However, it does not directly create topics by clicking on arbitrary non-existing links, unless incorporated via a custom system like the embedded comments setup. Here’s how dynamic topic creation via URL works:
Constructing the URL for Topic Creation
Basic new topic URL:
Add /new-topic to your site’s URL:
https://your-discourse-instance.com/new-topic
Clicking this will open a blank new topic composer for logged-in users. Non-logged-in users will be prompted to log in before composing.
2. Pre-fill topic fields with parameters:
To include predefined information such as title, body, category, or tags, use additional query parameters:
This approach works only for logged-in users. Non-logged-in users will need to sign in first.
Testing links beforehand is advisable to ensure all parameters function as expected.
If you’re looking for a completely automated dynamic linking solution (similar to embedded comments or a Wikipedia-style red link setup), that would require custom development or integration.