Disqus Comments area positioned incorrectly on page
shadyman@errora... - July 23, 2008 - 00:13
| Project: | Disqus |
| Version: | 6.x-1.x-dev |
| Component: | User interface |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Hi!
Disqus comments and entry box end up above the "link bar" that comes at the end of each node's content. I think it should be below there, like the normal Drupal comment area. This happens on at least the Garland, Stasis and Sky themes.
See screenshot.
Thanks in advance.
| Attachment | Size |
|---|---|
| elehackscreenshot.PNG | 99 KB |

#1
I 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
#2
If 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?
#3
This 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.
#4
Trying 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.
#5
I 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.
#6
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:
$node->content['disqus'] = array('#value' => $disqus,
'#weight' => 10,
);
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:
$node->disqus_comments = $disqus;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!
#7
Would love to figure out a solution here.
#8
why 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)
#9
I'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.
#10
Automatically closed -- issue fixed for 2 weeks with no activity.