# Embed Discourse comments with on-page commenting?

**URL:** https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609
**Category:** Feature
**Created:** [2016 年 9 月 14 日午後 4:45 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609 "2016-09-14T16:45:58Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![robypez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robypez/32/106859_2.png) [@robypez](https://meta.discourse.org/u/robypez)
#### Post date: [2016 年 9 月 14 日午後 4:45 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/1 "2016-09-14T16:45:58Z")

</div>

Do you think is possible to add the opportunity to reply comments directly on the page using api’s?

I need to trash my comment system and I don’t want Disqus ☹

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2016 年 9 月 14 日午後 5:10 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/2 "2016-09-14T17:10:00Z")

</div>

> [@Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963/158):
>
> Do you think is possible to add the opportunity to reply comments directly on the page using api’s?

That’s not planned at the moment, as stated many times in this topic.

---

<div class="post-metadata">

### Author: ![robypez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robypez/32/106859_2.png) [@robypez](https://meta.discourse.org/u/robypez)
#### Post date: [2016 年 9 月 14 日午後 5:39 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/3 "2016-09-14T17:39:03Z")

</div>

I know that the team has not planned this feature, but I want to know I using the api is possible to post from another page… I want to create an ember editor component on the post page.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2016 年 9 月 14 日午後 5:41 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/4 "2016-09-14T17:41:23Z")

</div>

> [@Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963/160):
>
> I want to know I using the api is possible to post from another page

Yes! You can use the API to do **anything**!

However, it isn´t dead easy. You can’t expose API in the JS world, so you´ll need some backend service do to the middle work between your page with comments and discourse.

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2016 年 9 月 14 日午後 6:10 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/5 "2016-09-14T18:10:50Z")

</div>

> [@Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963/160):
>
> I want to create an ember editor component on the post page.

This is going to be extra challenging because the embedded code doesn’t use Ember 🙂

It’s designed to be super fast and lightweight because it’s embedded in other people’s sites, so it’s just vanilla HTML/CSS and a small amount of Javascript.

---

<div class="post-metadata">

### Author: ![robypez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robypez/32/106859_2.png) [@robypez](https://meta.discourse.org/u/robypez)
#### Post date: [2016 年 9 月 14 日午後 9:02 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/6 "2016-09-14T21:02:11Z")

</div>

I know, I just want to create an external editor not related to the embed code. Just a simple editor to add a reply…

---

<div class="post-metadata">

### Author: ![Paul\_May](https://avatars.discourse-cdn.com/v4/letter/p/6a8cbe/32.png) [@Paul\_May](https://meta.discourse.org/u/Paul_May)
#### Post date: [2016 年 9 月 20 日午前 11:53 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/7 "2016-09-20T11:53:55Z")

</div>

I’m also looking to do the same. Which API resources are available for this?

---

<div class="post-metadata">

### Author: ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)
#### Post date: [2016 年 9 月 20 日午後 2:14 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/8 "2016-09-20T14:14:14Z")

</div>

There are unfortunately no API hooks for this, since it uses a different non-Javascript code path that’s never been extended before. I would gladly accept a PR that adds some though, if you can figure out what you need to have added.

---

<div class="post-metadata">

### Author: ![robypez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/robypez/32/106859_2.png) [@robypez](https://meta.discourse.org/u/robypez)
#### Post date: [2016 年 9 月 21 日午後 4:34 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/9 "2016-09-21T16:34:12Z")

</div>

@Paul_May

With the api you can create a new reply, so my idea is to create an editor on the post page to add a new reply to the related forum discussion. This is not related to the discourse embed js, I will keep my editor totally separated: is just an editor that on submit create a reply using the api.

I think it’s not difficult, but I will lose a lot of Discourse features like to opportunity to like post.

---

<div class="post-metadata">

### Author: ![ibox](https://avatars.discourse-cdn.com/v4/letter/i/f05b48/32.png) [@ibox](https://meta.discourse.org/u/ibox)
#### Post date: [2017 年 3 月 22 日午後 8:52 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/10 "2017-03-22T20:52:30Z")

</div>

Hi,  
do you have some plan on adding a posting interface in the embedded JS? The process to go to the forum is really timely and having the ability to directly comment in the iframe would be great (with the SSO, the user would have a smoothless experience)

Thanks a lot

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [2017 年 3 月 22 日午後 9:40 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/11 "2017-03-22T21:40:11Z")

</div>

> [@Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963/189):
>
> do you have some plan on adding a posting interface in the embedded JS? The process to go to the forum is really timely and having the ability to directly comment in the iframe would be great (with the SSO, the user would have a smoothless experience)

[https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963/67?u=falco](https://meta.discourse.org/t/embedding-discourse-comments-via-javascript/31963/67)

---

<div class="post-metadata">

### Author: ![ibox](https://avatars.discourse-cdn.com/v4/letter/i/f05b48/32.png) [@ibox](https://meta.discourse.org/u/ibox)
#### Post date: [2017 年 3 月 22 日午後 10:48 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/12 "2017-03-22T22:48:57Z")

</div>

Thanks for the reply 🙂

---

<div class="post-metadata">

### Author: ![elSpectre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elspectre/32/46976_2.png) [@elSpectre](https://meta.discourse.org/u/elSpectre)
#### Post date: [2017 年 3 月 23 日午後 2:23 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/13 "2017-03-23T14:23:05Z")

</div>

@codinghorror adding comments on our site pages would actually add topics and activity for our community. Basically, the site pages are jumping off points that would drive conversation.

We have tried plugging in comment systems, but they pale in comparison to what Discourse can provide. We see the comment pages as just an extension to current conversations in the community and as an on boarding path for new members.

We love Discourse and it has 90% of what we need to keep all the site ‘conversations’ happening in one system, which is huge for us.

I tried the way comments work on your blog. The the approach of flipping someone into a Discourse topics page is a bit of a shock, but we’re trying that for a start.

The thing is that the mental model for comments is pretty strongly ‘in place’ on the page where you see the comment. So, that’s where our need for this really lies. And, again really as a place to onboard people to the community.

> **[Userspice Site](https://www.rifflebooks.com/list/89459)**
>
> Powered by UserSpice

---

<div class="post-metadata">

### Author: ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)
#### Post date: [2017 年 3 月 23 日午後 3:32 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/14 "2017-03-23T15:32:15Z")

</div>

I guess I haven’t had enough coffee yet, but going to the site you linked to I did not find an example of comments (unless that is what reviews are) and did not find a way to experience the “flipping into a Discourse topics page” you described. What am I missing?

---

<div class="post-metadata">

### Author: ![elSpectre](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elspectre/32/46976_2.png) [@elSpectre](https://meta.discourse.org/u/elSpectre)
#### Post date: [2017 年 3 月 23 日午後 3:57 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/15 "2017-03-23T15:57:09Z")

</div>

Sorry, I was just giving an example of where we’d put the ‘comments’. We have a whole discussion board that’s run by Discourse and are trying to stay away from having a comment solution that’s separate.

So, the book list page mentioned above would become a ‘topic’ in Discourse and we’ll put the comments under that.

You can see the current comments approach on codinghorror’s blog. [Password Rules Are Bullshit](https://blog.codinghorror.com/password-rules-are-bullshit/)

There’s a link after the post that says “continue discussion”. That’s where you’ll be dropped into a Discourse topic for the blog post.

---

<div class="post-metadata">

### Author: ![whitneyland](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/whitneyland/32/121121_2.png) [@whitneyland](https://meta.discourse.org/u/whitneyland)
#### Post date: [2017 年 4 月 23 日午前 2:18 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/16 "2017-04-23T02:18:42Z")

</div>

I’ve started to research Discourse as a general solution and started with embed capabilities. To be frank the whole situation seems to be a bit of a mess.

This thread has many requests based on what makes sense for users, and many replies of implausibility based on limitations of the architecture. This doesn’t sound good – the latter should be informed by the former, especially for what appear to be common or not an edge case scenarios.

> > Would it be possible to only create the topic when someone publishes a comment?  
> > No, it is a huge change architecture wise. On Discourse you need to post replies on topics. There is no concept of \>\>“replying to a topic that doesn’t exist yet.”

How could this require a huge change to a well designed architecture? Of course, no design can do everything well nor should it try. However embedding scenarios have existed longer than Discourse has. Even if embedding was not an original goal I’m not sure why the door wouldn’t be left open. Sometimes things change.

> > Can’t we use an API to help the situation?  
> > No, that would be very insecure. You can’t trust what the client passes to you to create topics.  
> > It’s important that the Discourse instance makes a GET request to a server you have whitelisted as embeddable…  
> > you’ll have to trust me when I say this is not easy to do.

Are you sure the API would have to be very insecure? You’re the expert on your code, but I don’t see a problem in principle here. I guess a big difference would be if you’re talking about existing code limitations vs. what best practices would be in general.

[people wanting to get rid of the “Continue Discussion” limitation]

> > No, we won’t be doing that – the goal is to drive people to the community site, not be a comment engine for a random webpage.

You know what, I would post that at the top of this thread in a large font because it’s a strategic bet you’re making that everyone should be able to get on board with or not right up font.

I don’t mean to sound disagreeable in this thread and I usually find it quite pleasant to talk with other developers. I must admit feeling a little defensive after reading a few different threads where Robin said something to the effect of “well if you don’t like it maybe you’d be better off with another product”.

Is that technically a true statement? Sure. Does it sound good? I think often it gives the wrong impression. I mean the content adds no value right? If a feature is not going to be implemented, I’d suggest it’s good enough just to say something like “sorry, that’s not on our roadmap at the moment but we appreciate the feedback.”.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017 年 4 月 23 日午前 2:24 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/17 "2017-04-23T02:24:30Z")

</div>

> [@Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963/204):
>
> Even if embedding was not an original goal I’m not sure why the door wouldn’t be left open.

Apparently you haven’t met me. There is nothing I love more than slamming the door closed on directions we don’t want to go in. Then nailing them shut and painting over them.

Building a great product is about saying yes to a few things and [no to everything else](https://blog.codinghorror.com/just-say-no/). If you don’t understand that, with respect, show me what you have built.

---

<div class="post-metadata">

### Author: ![whitneyland](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/whitneyland/32/121121_2.png) [@whitneyland](https://meta.discourse.org/u/whitneyland)
#### Post date: [2017 年 4 月 23 日午後 7:13 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/18 "2017-04-23T19:13:00Z")

</div>

I’m just going by what I’ve read in this thread, where it seems that multiple times responses talked about something being really hard for technical reasons relating to how Discourse works. Since some of these requests seem like a good thing, I’m inferring the limiting factor is tech, rather than simply deciding priorities and optimal workflow.

If I didn’t infer that correctly that’s fantastic, I would be glad to learn that’s not the case.

Regarding your blog post, I don’t see how I have disagreed with anything there. In fact I explicitly said no one should try do to everything well or be expected to do so. Shouldn’t it be possible to agree with the philosophy, but disagree with the things that a product has chosen to say yes to?

Regarding my resume, I’m not sure how that changes whether my suggestions are valid. If you’re asking if I can empathize with what it takes to create complex software that is good enough for people to like and/or pay money for, then yes I have done that as a startup and at other companies. I know it’s not easy like climbing Everest wearing shorts is not easy. I do empathize.

I also know it requires constructive criticism, which was my intention believe it or not. To be constructive I think requires going beyond complaining, to try and suggest things that (I believe anyway) may help improve a product or company. I will try to be more clear and concise on these suggestions:

1. I believe embedding should be one of the few Yes items, and receive your best shot at a great UX that is competitive with Disqus. I think you could actually provide a superior experience by leveraging what’s been accomplished with the Discourse foundation.

2. The first item would require it to be compatible with your direction, strategy, business model. If it’s not that’s fine, but with hundreds of posts discussing embedding, I would suggest it makes sense to clarify that it’s considered more of a minor capability, rather than a core scenario at this point. If you’ve already done this my apologies, but googling did not tell me that.

3. To an outsider, limitations around how and when topics can be named, and how APIs cannot be called securely, don’t make sense. I don’t doubt there are real and challenging problems, but I would find it normal for people to question that if it were the only info provided.

4. I would suggest changing how you tell people “no”, such that it doesn’t involve suggesting they go find another product. If you did a survey asking people which way left them feeling more positive about Discourse, I think my example would win handily.

Am I right in my suggestions? Who knows, I’m some guy on the Internet who doesn’t create community software for a living. But for me personally, I would want to hear feedback like this. Once in a while a post might influence me, most probably not, some may just plant a seed of thought for the future.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2017 年 4 月 24 日午前 3:16 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/19 "2017-04-24T03:16:56Z")

</div>

On page commenting is a radically different product, and not at all comparable to the community we’re trying to build. There is plenty of existing discussion on this if you wish to read through it.

---

<div class="post-metadata">

### Author: ![Remah](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/remah/32/70590_2.png) [@Remah](https://meta.discourse.org/u/Remah)
#### Post date: [2017 年 4 月 24 日午前 3:45 UTC](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609/20 "2017-04-24T03:45:33Z")

</div>

> [@Embed Discourse comments on another website via Javascript](https://meta.discourse.org/t/embed-discourse-comments-on-another-website-via-javascript/31963/206):
>
> 1. I believe embedding should be one of the few Yes items, and receive your best shot at a great UX that is competitive with Disqus. I think you could actually provide a superior experience by leveraging what’s been accomplished with the Discourse foundation.

I don’t because I don’t see Disqus as competing with Discourse.

Discourse is clearly focused on one community at a time. Disqus is clearly focussed on comments for published documents such as blogs in more than one community. The idea of community is compromised in ways that the Discourse team will never allow.

You are right that there is clearly an opportunity to leverage Discourse - and thanks for expressing yourself so clearly and politely. And it would be easy to take that path **But** the opportunity cost is way too high when core Discourse has so much more yet to be realised on the road map.

[次のページ](https://meta.discourse.org/t/embed-discourse-comments-with-on-page-commenting/61609.md?page=2)
