Create topic when a link is clicked


(Rob Nicholson) #1

Yet another random thought. CAMRA uses Discourse. It’s recently also launched a news site running on WordPress. Here is an example article:

https://wb.camra.org.uk/2017/08/06/camra-calls-for-new-business-rate-relief-for-pubs/

As you can see, there is the standard WordPress comment system at the bottom. I’ve suggested that there is some merit in trying to bring those comments into Discourse - mainly so that discussions are more centralised and (maybe more importantly) moderated.

So the requirement would be for a link to be added to the WordPress article that when clicked either a) prompts the user to start a new topic in Discourse or b) opens the existing topic if it’s already been created. More importantly, one doesn’t want to have to create the Discourse topic manually for each article when the majority of them might never be commented on.

Is this kind of thing a) possible out of the box, b) feasible with some custom development and c) not really possible cleanly?


(David Taylor) #2

Topics are automatically created when you use the embedded comments feature:

See articles on https://blog.codinghorror.com for an example

For Wordpress setting this up can be done with the Wordpress plugin:


(Rob Nicholson) #3

That’s definitely barking up the right tree, but this bit might be a problem at first glance:

If you set this up correctly, the first time you visit http://example.com/blog/entry-123.html it will try to load comments for the blog post. Since there are none, it will tell the Discourse forum to create a new topic in the background. A new topic will be created by eviltrout and the contents of the first post will be crawled from your blog and the text will be extracted automatically.

That means that the topic will be created in Discourse when the first person opens the article? For Coding Horror that’s fine because I doubt there has ever been a Coding Horror blog article that’s not generated comments.

I’ll read the rest of the instructions later as I appreciate, this might be covered later.