Plugin: Ask me anything or Q&A format (threaded replies)

Ah, that’s not what I’d call “one level” threading.


Unless I’m missing an easier way to do it, this would require significantly more work than JavaScript and CSS alone could do.

Not only would the DOM need to be substituted but the database would need changing too.

I thought the current forum already supports this question-answer-comment structure, just displaying it in a different way.

right now it looks like

	Answer 1
	Answer 2
        Comment 1 to Answer 1
	Comment 1 to Answer 2
        Comment 2 to Answer 2
        Comment 2 to Answer 1
	Answer 3
        Comment 3 to Answer 1
	Comment 1 to Answer 3

but the good news is each answer can already show it’s comments. (replies to them)

so what I can think of involves only two tasks

  1. display those comments as the button is clicked
  2. hidden those posts that have already been displayed.

why do we need to change the database?

I know messing with the post stream is bad bad bad, but like you I came to the conclusion that we just need to…

  • hide replies from the main stream, just like we do with filters that show only posts from one author, or topic summaries;
  • show the “X Replies” tab expanded by default.

Probably the biggest challenge would be what to do upon posting, since Discourse will always show your reply in the main stream. To solve this we’d have to…

  1. Force-enable the Don't jump to my post after I reply user setting on Q&A/introduction topics
  2. Live update the “X Replies” tab. We do increment the X by 1 upon posting, but the most recent nested reply will not show up until you refresh and expand the tab again.

@joebuhlig expressed interest in working on such a plugin, so if someone’s able to fund this work (unfortunately it’s not currently the type of work can fund) then go for it!


I haven’t looked into it yet, but there is the post_custom_fields table that might be able to put the restrictions on who can reply to what without the need for adding a new table / fields.

I’m also wondering if thinking in terms of hiding - expanding is a bit of a red herring. Seems to me that the end result would be reordered posts so it might be easier to just shuffle the post number values around every new post. (queued transactions?)

Perhaps I’m being dense but I can’t seem to figure it out - how does one force a full quote on every reply? Thanks!

What you mean by “full quote”? More importantly, why would you want that?

From the earlier posts as a workaround if one wants an attempt at threading on their site

You would have to write a plugin for that.

1 Like

Near the end of July I’m planning to release a premium section for one of my sites. One of the paid categories that will come with that is geared towards monthly AMAs. So between now and then I want to take a stab at a plugin for this and I’m hoping that in the process of doing these regularly I’ll be able to nail down a good way to do them with Discourse. That said, I need to develop the technical plan for this ahead of time.

It seems that the consensus is the need for mandatory full quoting by the answerer. I’m not sure that’s far enough though. Would it make more sense to automatically add the full quote if a quote hasn’t already been added to the reply? That would allow answerers who can handle the etiquette of an AMA via Discourse to quote the question itself and not always the full post. But at the same time, it would catch those who are new to it.

And if you’re forcing the full quote, would you also hide the Reply button at the bottom of the thread for the answerer only? That way they have to reply to a specific post and allow the aforementioned check?

To allow this, it would require two topic level settings. One, mark the topic as an AMA. Two, tell me who the answerer for the topic is. The latter would also allow the addition of a CSS class to their posts and the addition of coloring/flagging of the answerer on that specific topic.

There have been mentions of expanding replies automatically, but is that necessary if the path I’ve laid out is in place?


The answerer should be the topic owner so that part is straightforward.

1 Like

I wouldn’t say full consensus; I certainly don’t think that’s the best way. With that workaround, an alternative like Reddit is just so much better because there’s no duplication of text content.

I feel like my aforementioned suggestion just hasn’t been explained well enough. I made a video to properly illustrate what the posting process should look like:

There’s no hackery going on here. I’m merely skipping past the part where Discourse jumps to the bottom of the topic. Instead I transition to the filtered version of the topic with inline replies. The big question is whether this can easily be skipped in code as well.

My basic spec of the plugin would be:

  • Add category-specific setting “enable AMA mode”
  • “Reply (to topic)” is replaced with “Ask question”
  • OP is the designated AMA host with special privileges
  • Posts to the topic (i.e. Questions) by other users can only be replied after OP has replied. Before then, there’s no “reply” button visible to them.
  • OP’s replies will be highlighted.
  • All Replies (not Questions) will be hidden from the main stream by default. Instead they will be shown as inline replies by default. In other words this would be quite similar to how ?username_filters=someuser works.

That mockup makes a lot of sense to me. It’s quite a bit different than what I originally thought you were suggesting. I could get on board with that process as it seems to be much cleaner.

Edit: I assume this needs to be a plugin and not a PR. Correct?


Absolutely, this has to start as a plugin.


I disagree with this; there’s plenty of text content duplication in reddit during AMAs. Also any line of thought that begins with “no text reply duplication!” is deeply incompatible with what we’ve been building for the last four years.

What you proposed is probably a month of full time work for an engineer to implement. Much simpler to just:

  • disallow more than one “level” of replying, that is, the audience can only post questions as replies to the topic and cannot reply to any individual posts. Only the AMA subject can reply to individual posts.

  • enforce quoting by the author when replying, every time the AMA subject presses the reply button, put a quote in on their behalf. Error out if the AMA subject somehow tries to save a reply without a quote.

It is the difference between one day of work, and 30 days of work. It also gets you 90% of the way there in my estimation.

It also does not require readers to click expand a ton of times to see actual replies. If they want to see replies docked, they can, but simply reading quoted text is what Discourse is about in the first place, not enforced and hacked in multi-level threading.


Is anybody working on this plugin?

1 Like

I’m planning to jump into in a week or so. I want it for a premium section in one of my communities released in early August.


@erlend_sh, it’s been a while, but do you remember how you did this on the front end? I can use the parameter username_filters to hide the post at the bottom but I’m not seeing a way to do that without a server call in any way.

For those interested, I have the category setting in place and it automatically expands replies. :wink:


You mean where to find it in the front-end interface? I’m talking about this thing:

I used that to show only posts by the user @question-asker. In the cases of the Q&A format you’d want that filter for every post that is a direct reply to the OP.

I’m essentially trying to find a front end way to hide the post at the bottom when replying to a question so it’s not duplicated on the screen. But when you click on the button you mentioned, it reloads the page to get it done. Is there way to hide a post via javascript? I haven’t been able to find that piece.

Hmmm, you might want to repost that query to #dev for more exposure. @david made a PR for something possibly related to this: