# Discourse commenting for more complex, dynamic website

**URL:** https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350
**Category:** Feature
**Created:** [2014年五月6日 10:28 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350 "2014-05-06T10:28:52Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![realart](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@realart](https://meta.discourse.org/u/realart)
#### Post date: [2014年五月6日 10:28 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/1 "2014-05-06T10:28:52Z")

</div>

I am contemplating on replacing proprietary commenting system for [fastestlaps.com](http://fastestlaps.com) with discourse.

Site has different kinds of content pages which have to be comment-able - car pages, laptime pages, article pages, even highly dynamic comparison pages.

**I would like to use discourse javascript embedding for comments on these pages, in such a way that each type of page creates a thread in it’s corresponding discourse forum category, as soon as the first commenter leaves a comment.**

The threads would also have to have generic topic names.

For example:

- First post in a carpage creates a topic in forum cat “Carpage  
comments” with a generic name “Ferrari ABC comments”.
- First post in an article page creates a topic in forum cat  
“Article comments” with a generic name “This is a nice article  
title etc”

I would also need a widget for latest posts and threads with links to actual pages (carpages, article pages etc) or “native” discourse forum topics (to [community.fastestlaps.com](http://community.fastestlaps.com)) if those threads/posts do not belong to a fastestlaps page.

The widget data I supposed I could try to fetch via some kind of json-ish discourse api (if such exists). Determining the links for each post would be the bigger issue.

Comment areas themselves I would like to generate with disqus-like javascript embed, I assume discourse has it. The issue here is that I would need to specify in that embed code the thread name and category, if that’s even possible.

Also, if discourse associates embedded threads only with embed (master) page URL, what would happen if the master page URL changes?

So, is the described application possible, without hacking the discourse core?

Having a separate system take care of the community/discussion aspect of the page would reduce complexity and let me concentrate on the features that are actually unique to the page.

I also plan to replace my own blogging solution with wordpress, which is very doable via wordpress json API plugin. So, ideally, the site would be three separate services - core site + wordpress or blog + discourse for community/user management.

**If discourse was usable in this way - as a very adaptable “community system for a website”, it would greatly increase it’s adoption - I bet I am not the only one having these same ideas.**

So far I haven’t found a system that would meet these requirements.

---

<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: [2014年五月6日 18:47 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/2 "2014-05-06T18:47:14Z")

</div>

There are two options:

Static embedding  
[http://eviltrout.com/2014/01/22/embedding-discourse.html](http://eviltrout.com/2014/01/22/embedding-discourse.html)

And our WordPress plugin at  
[https://github.com/discourse/wp-discourse](https://github.com/discourse/wp-discourse)

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [2014年五月6日 20:02 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/3 "2014-05-06T20:02:35Z")

</div>

> [@codinghorror](#):
>
> Static embedding  
> [http://eviltrout.com/2014/01/22/embedding-discourse.html](http://eviltrout.com/2014/01/22/embedding-discourse.html)

The “static site” embedding almost meets this requirement: [quote=“realart, post:1, topic:15350”]  
each type of page creates a thread in it’s corresponding discourse forum category, as soon as the first commenter leaves a comment.  
[/quote]

The way it currently works, the topic will be created as soon as a web browser loads the page for the first time.

---

<div class="post-metadata">

### Author: ![realart](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@realart](https://meta.discourse.org/u/realart)
#### Post date: [2014年五月6日 20:06 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/4 "2014-05-06T20:06:07Z")

</div>

I have red the suggested post on [eviltrout.com](http://eviltrout.com) (static embedding) before and it left me with following questions (which is why I started this thread):

When using static embedding:

- Can I specify topic name?
- Can I specify category?
- What do I do if page URL changes (“Cool URLs don’t change”, but  
let’s be realistic)?

In the [eviltrout.com](http://eviltrout.com) example embed.js receives two parameters: “discourseUrl” and “discourseEmbedUrl”.

I would require something along the lines of “categoryID” and “topicName”.

---

<div class="post-metadata">

### Author: ![realart](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@realart](https://meta.discourse.org/u/realart)
#### Post date: [2014年五月6日 20:16 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/5 "2014-05-06T20:16:17Z")

</div>

> [@riking](#):
>
> The way it currently works, the topic will be created as soon as a web browser loads the page for the first time.

I think that could be good enough. I am more concerned about above questions.

---

<div class="post-metadata">

### Author: ![realart](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@realart](https://meta.discourse.org/u/realart)
#### Post date: [2014年五月10日 21:15 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/6 "2014-05-10T21:15:53Z")

</div>

> [@realart](#):
>
> When using static embedding:
> 
> Can I specify topic name?  
> Can I specify category?  
> What do I do if page URL changes (“Cool URLs don’t change”, butlet’s be realistic)?

No answers or these questions?

---

<div class="post-metadata">

### Author: ![nukeador](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nukeador/32/107477_2.png) [@nukeador](https://meta.discourse.org/u/nukeador)
#### Post date: [2014年十月9日 09:59 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/7 "2014-10-09T09:59:48Z")

</div>

> [@realart](#):
>
> Can I specify category?

On the post comments I see they are talking about _embed\_category_ variable:

[http://fishtank.eviltrout.com/t/embedding-discourse-in-static-sites/87/19](http://fishtank.eviltrout.com/t/embedding-discourse-in-static-sites/87/19)

@codinghorror where is the full documentation about this?

---

<div class="post-metadata">

### Author: ![realart](https://avatars.discourse-cdn.com/v4/letter/r/8edcca/32.png) [@realart](https://meta.discourse.org/u/realart)
#### Post date: [2014年十月13日 16:54 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/8 "2014-10-13T16:54:44Z")

</div>

I am still very keen on finding a solution for this. I have a decent size website long overdue for a better commenting / forum system.

Discourse needs a fully functional API / integration options, to make it usable “as a service”.

---

<div class="post-metadata">

### Author: ![philooo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philooo/32/115228_2.png) [@philooo](https://meta.discourse.org/u/philooo)
#### Post date: [2014年十一月19日 03:34 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/9 "2014-11-19T03:34:13Z")

</div>

> [@nukeador](#):
>
> embed\_category

Any news about that variable being active ? My site is heavily segmented between cars and motorcycles and I really need to be able to send my post into their own ‘cars’ and ‘motorcycles’ categories ..

Without it I can’t implement what I think to be the best forum code out there today ☹

---

<div class="post-metadata">

### Author: ![philooo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/philooo/32/115228_2.png) [@philooo](https://meta.discourse.org/u/philooo)
#### Post date: [2014年十一月19日 16:20 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/10 "2014-11-19T16:20:29Z")

</div>

I found a WP plugin for Discourse, claiming that they can define the ‘Category’  
 → [GitHub - discourse/wp-discourse: WordPress plugin that lets you use Discourse as the community engine for a WordPress blog · GitHub](https://github.com/discourse/wp-discourse)

I am looking into the code but I can’t seem to find how they do it. If someone is familiar with this plugin I’d love to know if this is working or just wishful thinking ;(

![](https://global.discourse-cdn.com/meta/original/3X/b/e/be38d3486786e83823baabd154be7615ad1a6314.jpg)

* * *

What I wish for:

```
<script type="text/javascript">
  var discourseUrl = "http://forums.domain.tld/",
  		discourseUserName = 'Username',
  		discourseEmbedCategory = 'Category/Sub-category',
      discourseEmbedUrl = 'http://forums.domain.tld/article-url.html';

  (function() {
    var d = document.createElement('script'); d.type = 'text/javascript'; d.async = true;
      d.src = discourseUrl + 'javascripts/embed.js';
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(d);
  })();
</script>

```

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [2014年十一月19日 18:26 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/11 "2014-11-19T18:26:05Z")

</div>

See this category for support on this plugin:

> **[WordPress](https://meta.discourse.org/c/support/wordpress/21)**
>
> Support for the official Discourse WordPress plugin at GitHub - discourse/wp-discourse: WordPress plugin that lets you use Discourse as the community engine for a WordPress blog

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [2025年十二月4日 11:14 UTC](https://meta.discourse.org/t/discourse-commenting-for-more-complex-dynamic-website/15350/12 "2025-12-04T11:14:23Z")

</div>


