Embedding Discourse Comments via Javascript

SVGs are essential to my application since it is about data visualisation, is there any way I can make this work?

The relevant code is here. It uses ruby-readability as a base library.

If you have the time and know your way around ruby, you could dig into how it works and see what’s involved in getting SVGs to work.

1 Like

Is there any way to embed the statistics frame form the admin panel like a post somewhere else?
If yes, how can this be accomplished?

Thanks a lot :slight_smile:

There is no way to embed anything like that right now. You would be better off using the API and creating such a feature yourself.


So if I understand this correctly, the Embedded CSS section is how the content for the javascripts/embed.js is displayed on the site that you want to embed comments from a topic for?

1 Like


I know this is an old question but have you found a solution to reverse the order of the embedded posts? Has this functionality been implemented since?

I am trying to use a hidden topic that I embed on my website as a mean to publish some news. I found this recent topic on the matter which for now does not get much attention so I am trying here as well.

I also wonder how to make the embedded iframe scrollable. Any idea?

Many Thanks!

1 Like

Is there a way to create the topic, only when someone actually posts a comment? I have thousands of blog posts. this way It would spam my forum.
Any Idea or suggestion for my situation?

BTW, It is also not compatible with RTL language.

Is it possible to delete the extracted text from the first post? I seem unable to do this. I can only delete the text above the “Show Full Post” button but not the contents of the Post themselves.

Forgive me if it’s already been answered or asked / suggested but I couldn’t find it… If there’s a topic with a large number of replies, how do we restrict the number that are displayed and then offer a “Read More” kind of thing…?

That what the second setting in the embed page does: Maximum number of posts to embed.


DOH! Good thing I have an eye appointment scheduled for next year… If I make it that far

1 Like

Hello. I cannot add cyrillic domain as hostname to allowed hosts.


I can add domain.test, but it now work for embedding. And I cannot add any cyrillic domain with punycode :frowning:

Can you help? Thank you.

I think the problem might have been that I used the “system” user as the poster for embedded topics (not sure if that’s allowed), or maybe I just didn’t wait long enough. I changed it to my username and checked back some time later, and now I have topics!

However, I am getting an error when trying to actually display the comments: the response is a 404 not found (with an X-Frame-Options header set to SAMEORIGIN, so it displays nothing but I can see it in the console).

1 Like

So having read through pretty much everything in this thread, and having implemented the embedding of topics into our blog, we’re seeing a reduction in engagement because people have to first sign into the forum in order to comment. Any ideas on how others are dealing with this?

EDIT: I get that, from other things I have read, if you enable Discourse SSO then it would automagically work that way… but when that’s not an option? Like because you’re an authentication cloud provider and your Discourse instance is using your service as the SSO…

1 Like

I get the concern here, when you are mega popular the extra barrier is actually a huge benefit, but when you are not the most popular person in the room you really want to reduce all the barriers for participation. The good old “enter email”, “enter comment” form is significantly less barrier than signing up to another site with all that it implies.

That said this is not an area we explored quite yet, we are working on improving the review queue at the moment. I think if the review queue is solid enough this is an experiment I would consider running on my blog. I would not expect any big announcements here though for the next year or so.


Honestly if login free on-page commenting is your highest priority, I recommend you do not use Discourse.


Yeah, that’s what I am thinking as well.

Did you solve this ?

This is a great feature. Thanks so much.

Note: There is one issue I found, when embedding an existing topic: The first post in the topic is not included in the comments.

That’s because

The first post is supposed to be an excerpt of that document and a link to it.