Closed (fixed)
Project:
Disqus
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
18 Sep 2009 at 01:33 UTC
Updated:
2 Nov 2009 at 18:00 UTC
Is there a way to move the disqus block out $content so that I could position it below the node's main theme section?
I notice this in the disqus.module code:
$node->content['disqus'] = array(
'#value' => $disqus,
'#weight' => 10,
I am wondering if that could be altered somehow? Any tips would be appreciated. Thanks!
Comments
Comment #1
robloachThis feature went into the Drupal 6 branch. It allowed the comments to be displayed in a block so you could move them anywhere you wanted. The patch wasn't back ported though since it was a large design change. If you want to have a look at disqus_block() in disqus.module, you'll see how it works.
I'm not opposed to any patches ;-) . Would love for it to be in the Drupal 5 branch, just haven't had the availability to back port it.... Any help is welcome.
Comment #2
interestingaftermath commentedThat's too bad. I don't have the ability to back port the module myself and it doesn't look like anyone will be coming along anytime soon to do so. Looks like my client will be stuck with Drupal comments :(
Comment #3
interestingaftermath commentedI would be willing to donate for a patch of this feature for 5.0.
Comment #4
interestingaftermath commentedI found this in another thread. Going to try it tonight!
I too didn't want the Disqus comment injected straight into the body. Instead, I'd rather have control over where they appeared by using my theme. I currently use Drupal 5.x, so these instructions maybe a little different for 6.x, but I've managed to figure out how to do this.
Line 76-79 in disqus.module currently has this:
As jluster said above, this injects the Disqus code into the body with a weight of 10. If you're fine having the node links below the comments, you can modify the weight value to how you'd like it. Otherwise, change the code to this:
This creates a variable when the node is viewed called $disqus_comments that you can place anywhere in your node.tpl.php
Someone else can chime in and tell you if the code is any different for Drupal 6.x, but this is the Drupal 5.x solution. Thanks!
Comment #5
robloachThe Drupal 6 version is much nicer as it sticks it in $node->disqus during "load":
The solution should be very similar in the Drupal 5 version. Note that the
variable_get('disqus_location', 'content_area')is where you have the ability to set it as a block ;-) .Comment #6
interestingaftermath commentedI was able to do the quick tweak I mentioned above and it worked just perfectly. I have disqus running on my site and the client is happy: e.g. http://davianletter.com/blog/2009/9/28/grains-fx-and-metal
Comment #7
robloachNicely done, it looks great! If you stick up a patch or some code or something, I'd love to have a look.
Comment #8
robloachI backported what was in Drupal 6: http://drupal.org/cvs?commit=276868