Any experience with Drupal to Discourse integration?

(Fulvio Corno) #1

We are creating a site based on Drupal, and we want to integrate Discourse as a discussion functionality within the site (we love its approach!).

We already have an instance of Discourse running on its own port, and we are looking how to best integrate the two.

Anyone has experience with the drupal module listed at Discourse Forum Integration | ?
Or better suggestions?

Thank you

(Jeff Atwood) #2

What do you mean by “integrate”? Can you be specific?

(versvs) #3

As they are using technologies sooo different, it will be really hard to integrate Drupal and Discourse under the same domain, right? So I think that maybe you can build a custom Drupal module that:

  • Every time a user account is created on your Drupal, it inserts a row in the user table of Discourse with appropiate data.
  • At the same time, it would be nice that you restrict direct account creation to your Discourse instance, that is running on a separate vhost (like discus.yourdomain.tld).
  • And finally you can probably embed discourse into your Drupal using whichever franken-frame you find.

I really love the Discourse approach to forums, but if you are looking to integrate with Drupal it may be a little too hard. Moreover considering that, though it may look “outdated” compared with an eye-candy app like Discourse, Drupal provides already with a consistent a very complete forum solution…

(Fulvio Corno) #4

Basically, on three levels:

  1. uniformity of graphical aspects (for this we’ll have to deploy
    custom css, header & footer)

  2. using drupal logins for Discourse authentication

  3. (optional) use the Discourse API for injecting new posts

For 1. and 3., we are basically seeking for documentation, if available.
For 2., we were wondering is someone already did that.

(Fulvio Corno) #5

I totally agree, they come from different centuries (millennia, actually). However, Our goal is to provide modern discussion capabilities to a traditional CMS-like workflow. Integration would mean running the two alongside, and synchronizing them with some API integration.

I found this Drupal module Discourse Forum Integration | and I’ll try it in the next days. I was just curious to know whether anyone had any experience with it.

(Régis Hanol) #6

For 1. there is the Customize CSS / Header Logos section of the Discourse Admin Quick Start Guide.

For 3. there is no documentation available yet as the API is not yet finished. Your only hope is to look at the code.

(Fulvio Corno) #7

ok, I understand and appreciate.
thanks for the feedback

(versvs) #8

Nice finding! :))

As someone who spent most of my day working with php sites (mainly drupal, in fact) It would be just nice to keep hearing from your project & integration :slight_smile:

(mojzis) #9

I am very much interested in simple integration (mostly SSO, the point 2 in your list) and was very glad to find about the drupal project.
But I am very unsure about its usability in real life, since it seems (from code and comments, havent tried it yet) that every requests is proxied via drupal, which sounds … slightly insane :slight_smile: given the number of requests and the cost of the drupal bootstrap.

One option would be to use Oauth, but it looks like the current providers are “baked in” and there is no easy way of adding another one ?

(mojzis) #10

With the recent addition of CAS, SSO with drupal can be acheived relatively easily thanks to the cas module for drupal. You need to enable ssl for the drupal site.
BTW, make sure you use the latest discourse code ( and higher).

(Craig Oda) #11

I would like to integrate the drupal blog module and use Discourse as the blog comment mechanism? Has anyone done this before? I am working with a company that has an existing website and blog using Drupal, but they are looking at using Discourse for the forum and blog comment pieces.

Anyone successfully do this?

It’s an existing blog, so I can’t easily get them to move to WordPress.

(Tobias Eigen) #12

Hi @codetricity and others here using drupal and considering discourse, like me. :smile:

I am currently exploring these links for static HTML embedding, which I think should work with trivial effort on drupal. Just add a block with the code to be displayed below every blog post, disable comments and go!

The javascript needs to be modified to provide the canonical URL to the page you want the comments displayed on. It would be nice to have a drupal module to handle this but a simple hack should suffice. I am part of the way there.

This solution assumes you want to have a “permeable membrane” between the editorial space (blog) and discussion space (discourse) on your site, which won’t work for all sites, but I am considering it for mine. @codinghorror makes a good case for it in his blog post:

I do not, and will not, offer in-page commenting here. If you want to reply with a comment, you go next door to the community clubhouse. There’s a fairly strong, but permeable, membrane between the editorial area here and the community area there. This is intentional.

Discourse Working as Comment Engine Replacement for Drupal
(Massimo Gorla) #13

Just a quick note to tell the Drupal Discourse module has been updated. The previous release was not compatible with newest Discourse, while this one has been tested with 1.2.0.beta5

I am still struggling to setup Drupal to work with this module, so I can’t confirm it works. More: if anyone is willing to help message me.

(Tobias Eigen) #14

What are you trying to do? That module, unless it’s been updated since I looked at it, misses one of the biggest integration opportunities which is to use discourse for handling blog comments. The embedding is unnecessary as is the SSO which disables some useful discourse functionality (eg invites, social logins).

So… depending on what you’re trying to get out of discourse and drupal, would suggest you set your sights on using discourse working as comment engine replacement for drupal which has worked nicely for me:

(Tarek Loubani) #15

After working on this for much too long, I’ve finally written a HOWTO for the use of OAuth2 to integrate the logins. See here:

I hope it saves you a bit of time!

tarek : )

(Zhilevan) #16

Thank you very much, I am looked for integration between discourse and Drupal 8 , for drupal 8 there is not any module, the big thing I need in discourse is only drupal users login and have activity in discourse, each time user create in Drupal With API we create a user in discourse.I’ll try your solution

(Tarek Loubani) #17

You will get some of what you want from OAuth2 integration. However, there is currently no mechanism to automatically create a user, but you will find the existing implementation adequate in most cases.

(Josh) #18

I’ve been thinking about a similar integration but decided to migrate all the users and content into Discourse, and then build a small Rails application for the pages and other Drupal 7 nodes that don’t get migrated into the forum. I’m still working out the details, but I think that it will be easier than integrating them. If the top-level Rails application needs user authentication, I’m thinking that Discourse’s SSO provider could handle that.

I’m searching the forum here for more Drupal 7 to Discourse migration information, but only found a couple of posts, so I thought I would comment here. If anyone has experience with Drupal 7 to Discourse migration, let me know. :slight_smile: