Active
Project:
Disqus
Version:
6.x-1.7
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
4 Aug 2010 at 12:16 UTC
Updated:
19 Jan 2012 at 17:33 UTC
Hi all!
I cannot for the life of me figure out how to integrate disqus comments into views. I have "blog" area of my site that I have made with views and I would like the disqus comments to to show on the compilation page. It works fine on the node when you click on the title, but I want it on the overview page, too. I have turned off comments for my blog-type content as per instructions, and disabled commenting site-wide to force comments with disqus, but there is no link, no hint that you can comment on the posts on the overview blog page.
Thanks for your help!
Comments
Comment #1
lintlin commentedWell, I did something and now it is displaying. Wish I could tell you what I did...
Still would be great to really know how to do this with views without "getting lucky" :)
Thanks again,
lintlin
Comment #2
narayanis commentedI'm having the same issue; Disqus comments are set to appear in the node content, and my View uses the node view, unformatted, with full build mode instead of teaser. any advice?
Comment #3
narayanis commentedUsing some code from a completely different issue, I created a custom views-row template for my view and did this:
Comment #4
SolasArd commentedI've run into more a less similiar problem on Drupal 7. On the frontpage view I've set node display to full, and the nodes display fine, and I even get the Disqus comments, but only for the first node. How do I get it to show under all nodes?
Comment #5
JimCraner commentedHey Narayanis, thanks for the snippet - it worked great!
For anyone else who, like me, is just getting into views template overriding, hopefully this helps:
If you get a "Object of class stdClass could not be converted to string" error centering on the "print $node;" line, check your override file's name. I was trying to use "node-view-VIEWNAME-DISPLAYNAME.tpl.php" as the template suggestion which doesn't work because $node is an object and not a string.
Instead, I placed the same snippet within "views-view-row-node--VIEWNAME--DISPLAYNAME.tpl.php" and it worked fine. If anyone is feeling "mentorful" and wants to explain why it worked in the second template suggestion file and not the first, I'd be appreciative :-)
Comment #6
andrewmugoya commentedIf you would like to display the Disqus comments on a page and would prefer to use a custom block, below is code you could use::
Comment #7
akosipax commentedthis is in response to #5, Like you said, the $node variable in the first template is an object because the first template is a node template. node templates have a $node variable too and it contains data about the current node or node being displayed.
on the other hand, the second template's a view template. the $node variable in this view template suggestion is just a string (the HTML output of the node template).