When I added disqus to seanreiser.com I thought it was simple, but one of my tweeps asked for a howto so maybe it wasn't . Also I seem to have had a few hits on from google searching on "disqus drupal". So for the curious here's are the steps I followed.
Caveats:
In all honestly I've done this twice, once the wrong way, and once the proper way.
Here is the Quicker, but Wrong Way
Here is Slightly More Complex, but Correct Way
The major advantage to the proper way is that the comments persist if you change themes.
You may also want to add your rss feed from disqus to your news aggregator and add the block to your sidebar.
Poof you're done. Good Luck!
Share and Enjoy!
/edit: Forgot to mention that you should disable the comment module.
/edit2: added enabling the block, ver 6.2 compatibility and some minor spelling errors, and the blog node type.
/edit3: I'm dropping disqus for now. The reasons are outlined here. I really like disqus and once they add comment importing I'll be back, but for today it's getting in the way of my grand design.
/edit4 I have reenabled Disqus. See this for more information
/edit5 Rob Loach has created a Disqus Module for Drupal 6 here
Sean Reiser, 40, is a developer, technologist, and amateur photographer. Sean has spent the past 20 years as a programmer, system architect and development manager. He is a life long New York resident.
Sean currently serves as the President and Chief Geek Officer of Repair Sense, Inc.. Please go to that site with any professional inquiries.
Sean can be found using a number of social networks. These are the ones he's most active on:
I finally have Disqus integrated to my drupal 6.2 blog site http://goteratv.com thanks to your pointers on how to get it done, would you mind if i use your instructions and translate them to spanish on my blog? to also help a few of my readers, ill link to your page and ill give you full credit for this and thank you so much , maybe a post on this on the drupal.org page or on the Disqus site would also benefit a lot of people since there is no info on this on any of those sites.
I tried Sean's instructions to the letter but can't get the Disqus comment block to display under the content using Drupal 6.2.
I had already used method 1 but would prefer the 'block' solution.
I tried different settings for 'Page Visibility' (blog/*) but still no joy. Any pointers ?
1) It's covered under a creative commons Attribution-Noncommercial-No Derivative license. Don't know if a translation is technically a derivative, but if it is feel free to translate this into Spanish. I'll go one step further I hereby grant anyone the right to translate this into the language of their choice as long as the content retains it's meaning and the other aspects of the license are still kept in force. Please also mention any translations in the comments here and I'll update the post appropriately.
2) Daniel Ha Already Posted this on the Disqus Blog (I mentioned it in their forums). I'll post something over in Drupal Land later today.
3) I'm curious, was it much different under 6.2?
Well.. looking at the instructions, I did forget to mention that you needed to turn on the block (Select "Content" from the dropdown on the block list page). I'll fix that in a bit.
If that isn't it try this in the validation (note that I have added a block type of blog):
<?php
$match = FALSE;
$types = array('story' => 1, 'page' => 1, 'blog'=>1);
if (arg(0) == 'node' && is_numeric(arg(1))) {
$nid = arg(1);
$node = node_load(array('nid' => $nid));
$type = $node->type;
if (isset($types[$type])) {
$match = TRUE;
}
}
return $match;
?>
Good Luck and let me know!
It's working fine now. Thanks a lot Sean. Nice to be able to switch themes and preserve Disqus functionality.
Yes, it worked for me too.
For my own edification was it the node type, not turning on the block or a third thing. If I can use these ver v 6.x directions I'll update the post.
It was failing to enable the Disqus block on the 'content' region. Obvious to experienced Drupal types but I am a clueless newbie.
However, I would probably include 'blog' as a node type in the example as I am sure this will be pretty common.
Couple of minor typo-ettes: 12. 'Past' -> 'paste' and on /edit 'to content' -> 'the content'
Thanks...
Well, welcome to Drupal!
I'll mention that it works for version 6.x as well then and correct the minor typos tonight (Blogging at 1AM is never a good idea).
If I get 10 mins I'll try and write a proper module instead of this hack, and merge it with the comments module. The nice thing about that approach is that we can backup the disqus comments into the current comment infrastructure so if disqus isn't around I don't lose my content history.
This is cool
That worked a treat, any idea how to add image nodes created using the image.module?
I don't use image.module (I host my photos on Flickr so I just grab the URL from there), but all things being equal, after you enable the module you just select image from under "create content".
Great step by step!!!
Yeah, I'm a new Drupal guy. Psyched about this solution. But one problem, I don't see this "drop down" menu with "content" as an option in the Blocks- List area. Any idea?
Sorry for the delay... was busy the last day or so... look here http://www.flickr.com/photos/sean_reiser/2501166714/sizes/o/ it's the menu marked "Region"
Thank you very much for response. The drop down that I have in that
screen only gives me the option to add it to the left sidebar. Which
makes me wonder if either this is specific to the theme you are using,
or if I am missing a module. How were you able to add "content" to
that particular drop down?
And by the way, this how-to was awesome. Exactly what a new guy like
me needs. Really appreciate.
Thanks Sean, I've got my Drupal blog updated with comments now, thanks to this posting, and it is interesting to see how the PHP conditional block worked. Without this tutorial I suspect I'd gone with the easy/wrong route. Next step, my written-from-scratch PHP photoblog.
Hey, nice job integrating Disqus! Looks good! Are you planning on massaging the Disqus CSS any?
Too much code to write right now to start tinkering with the disqus css. It blends in well enough for today.
There are a couple of ways I could've implemented the php block. If this was a module, I could've had a comments on / off switch similar to the one the comments module use.
Why write from scratch? Take a good look at some of the photo gallery type modules in drupal. you might find a solution to what you want without the work.
I'll mention that it works for version 6.x as well then and correct the minor typos tonight (Blogging at 1AM is never a good idea).
If I get 10 mins I'll try and write a proper module instead of this hack, and merge it with the comments module. The nice thing about that approach is that we can backup the disqus comments into the current comment web tasarım infrastructure so if disqus isn't around I don't lose my content history.
Yeah, when I started my photoblog back in August 2004 ( http://www.seemsartless.com/index.php?pic=37 ) there weren't nearly as many options as there are now, and Drupal was still in diapers, only 3 years old or so.
And I started the blog for two reasons, to force myself to learn more about photography, but also as a project to learn more about PHP and MySQL, etc... 979 unique photos later, it is safe to say that I've got the hang of things... ;-)
Just made a Disqus Drupal module: http://drupal.org/project/disqus . Might make it a bit easier.
Thank you Rob! I haven't had the time to do this. I'll check it out tonight, if I'm happy with it I'll update my posts accordingly
If you notice any features missing (like the hidden parameters), then
please let me know so we can add it in!
--
Rob
Uggh! I haven't made the jump to Drupal 6 yet on this blog (the cobbler's children always have the worst shoes). I haven't had the time to port my hand hacked modules over to D6 yet.
I'm curious... does your module back up the comments into Drupal's comment system. This might be useful as a fall back position should Disqus go down.
hi, just testing
Thanks for the great post.
@sreiser, Does your drupal tutorial allow Google to index your disqus comments? I did a quick search and it appears only the disqus community page is indexed...
Thanks for the great post.
thank you very much for this article
sohbet
I'm curious... does your module back up the comments into Drupal's comment system. This might be useful as a fall back position should Disqus go down.
Hi,
Thanks for sharing the " Correct Way " ... : )
I had try Intense Debate before, and I doesn't like it very much, may be I will try to use Disqus, but does Disqus had a different color for author comment?
I'm pretty sure that the siteowner's comments have a different CSS class then the other comments, so you should be able to theme it differently. BTW, if you're doing this with drupal, my comments are out of date, you should take a look at this module
@sreiser, Does your drupal tutorial allow Google to index your disqus comments? I did a quick search and it appears only the disqus community page is indexed...
Hi, You have really provided a great info . Specially i like that you have provided both of the ways to configure.
You rock
Thanks Kris http://ejumpmanual.com