Closed (works as designed)
Project:
Disqus
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Jul 2008 at 00:13 UTC
Updated:
19 Jun 2014 at 16:51 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
shadyman@erroraccessdenied.com commentedI think this positioning (as part of the node) leads to another problem: Search picks up the contents of the embedded disqus code.
See screenshot. Note the var disqus_title = "Tes"... in the second search result
Comment #2
robloachIf you know a way to stick it underneath the links, then I'd love to do it. I was considering possibly sticking the comments into a block, but not sure if that's the best place for them. I'm not sure, any thoughts?
Comment #3
jluster commentedThis is by design (not claiming it's good design :). Disqus injects its content into $content (as $node->content['disqus'] which comes, by design, before $links in most (all?) circumstances. The same design decisions makes it impossible, sadly, to have Disqus comments attached to any content type (CCK) that doesn't use this field in its node template.
Comment #4
reikiman commentedTrying to rationalize this away by saying it's by design misses the point.
In my estimation it's very bad in that it makes the 'links' area nearly impossible to find. Further it is not behaving the same as Drupal's normal comments, which themselves appear below the links area.
I just checked and .. in the Garland theme .. you can position a block in the "content" region and it appears below the links area. e.g. the Disqus Combo Widget Thingymajob is appearing in the place I would want the Disqus comment box to appear.
Another option is to add it to the links variable. Except doing so would violate some expectation that the links are short and small. Hurmph.
Comment #5
reikiman commentedI have an idea... Some DOM manipulation could move the disqus widget below the links when the page is rendered.
The links are a div with an appropriate id= to aid identifying where the links are. At least this is true in Garland I suppose other themes may render the links differently. Anyway when the disqus module includes the script tag for the disqus code it could also include a bit of jquery to move the disqus widget elsewhere.
Comment #6
pianomansam commentedI 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 #7
robloachWould love to figure out a solution here.
Comment #8
liza commentedwhy not have the comment form appear in a block?
what's wrong with that? (and no, it is not a rhetorical
question, i do want to know why it is not an option)
Comment #9
robloachI've committed a fix to add a "Disqus Comments" block that displays the comments when the "Block" location is set in the Disqus administration. It will be in the next 6.x-1.x-dev update, and the upcoming 6.x-1.5.
Comment #11
pianomansam commentedNew 6.x-1.5 version did not fix my problem of having Disqus comments directly injected into content. It is much more preferable to have them attached as property of the node. Attached is a quick patch file that will apply the necessary change to Drupal 6. It is the same approach as my Drupal 5 solution above in #6, but the line that gets inserted is this:
$node->disqus_comments = theme('disqus_comments', $node->disqus);Comment #12
robloachHow about this? Provide an option for the variable injection.
Comment #13
pianomansam commentedGreat work, Rob! This way admins can decide how they want the comments displayed.
Comment #14
Rhino commentedThis is interesting. I was looking to have Disqus and regular comments at the same time, and thus want Disqus to appear underneath the Drupal comments styled by comments.tpl
The only reason I want Disqus is to enable twitter & facebook comments, but as it appears, Disqus must show up in 'content', which places is above the communities comments and devalues them (visually).
Comment #15
robloachIf someone tests this patch, and then thinks it's ready to be committed, then sets the status to RTBC. I'd be happy to commit it :-) .
Comment #16
pankaj467 commentedHi All,
I am using garland theme. In comment section i want first comment form section then liasting of all comments. Currently it shows all listing comments then comes comment form section .
What can i do for that.
Thanks
Comment #17
WorldFallz commented@pankaj467
Please don't hijack issues like that. Reset to original settings.
Comment #18
pianomansam commentedI've applied Rob Loach's patch, even to 6.x-1.6, and it works beautifully. I have only tested it with Injected Variable because that's all I needed it for. I believe it is ready to be committed!
Comment #19
teastburn85 commentedI also applied the patch to 6.x-1.6 and it has worked very well. I also only tested "Injected Variable", but it works nicely for my uses. Thanks!
Comment #20
robloachhttp://drupal.org/cvs?commit=415166
http://drupal.org/cvs?commit=415158
Comment #21
robloachInjecting Disqus as a variable in Drupal 7 is broken, but not sure if it's even needed. Will leave this open to track. If you're using Drupal 7 and Disqus, mind sharing your thoughts here?
Comment #22
robloachRemoved this as it doesn't really need to be there in Drupal 7.
Comment #24
jive01 commentedWhy does this not have to be there in Drupal 7? The comments are still being posted above the submitted data. Is there a way to use hide() for the disqus comments to render them later?
Comment #25
robloachI believe
hide()and everything should work. Mind having a try at it? I assumed it wouldn't be needed since the Drupal 7 version uses renderable arrays rather then calling the theme() system directly.Comment #26
robloachIn Drupal 7, the Disqus element is a renderable array. I'd consider this fixed. If not though, feel free to post up some sample code and we can get it back in.
Comment #27
alan777 commentedTook me a while to track down the variable I needed to insert into my template file for the "Injected Variable" option. Might be a good idea to put into the help text:
<?php print $node->disqus_comments = theme('disqus_comments', $node->disqus); ?>Comment #28
WeRockYourWeb.com commentedI agree, couldn't find the inject variable until I found this! Thanks for posting this.
Comment #29
kpaul commented^^ Same.