I have a content view with a filter for one content type. I tried to add comments to the View by configuring in Views UI Format -> show -> content -> full content -> show comments.
Here is the markup:
I think what is important is the first character -- it is '1' not '<'. I walked through all my preprocess functions and templates and everything seems to be in order. Also, comments render correctly when not built in a View.
"1div id=\"comments\" class=\"comment-wrapper\">\n <h2 class=\"title\">Comments</h2>\n \n <a id=\"comment-212\"></a>\n<article about=\"/cruzr/comment/212#comment-212\" typeof=\"sioc:Post sioct:Comment\" class=\"comment comment-by-node-author comment-by-viewer clearfix clearfix\">\n\n \n <footer class='node-submitted clear-block'>\n <div class='user-picture'> <div class=\"user-picture\">\n <a href=\"/cruzr/users/admin\" title=\"View user profile.\"><img typeof=\"foaf:Image\" src=\"http://localhost/cruzr/sites/default/files/styles/user-s/public/pictures/picture-1-1306596694.jpg\" alt=\"admin's picture\" title=\"admin's picture\" /></a> </div>\n</div>\n <div class='byline'><span rel=\"sioc:has_creator\"><a href=\"/cruzr/users/admin\" title=\"View user profile.\" class=\"username\" xml:lang=\"\" about=\"/cruzr/users/admin\" typeof=\"sioc:UserAccount\" property=\"foaf:name\">admin</a></span></div>\n <div class='date'>3:07pm Today</div>\n </footer>\n\n <header class=\"title clearfix\">\n <a href=\"/cruzr/comment/212#comment-212\" class=\"permalink\" rel=\"bookmark\">#1</a> <em class=\"unpublished\"></em>\n \n \n </header>\n\n <div>\n <span rel=\"sioc:reply_of\" resource=\"/cruzr/content/review-bard-design-group-inc-admin-0\" class=\"rdf-meta\"></span><div class=\"field field-name-comment-body field-type-text-long field-label-hidden\"><div class=\"field-items\"><div class=\"field-item even\" property=\"content:encoded\"><p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>\n</div></div></div> </div>\n\n \n <nav class=\"links comment-links clearfix\"><ul class=\"links inline\"><li class=\"comment-delete first\"><a href=\"/cruzr/comment/212/delete\">delete</a></li><li class=\"comment-edit\"><a href=\"/cruzr/comment/212/edit\">edit</a></li><li class=\"comment-reply last\"><a href=\"/cruzr/comment/reply/212/212\">reply</a></li></ul></nav>\n \n</article>\n<a id=\"comment-213\"></a>\n<article about=\"/cruzr/comment/213#comment-213\" typeof=\"sioc:Post sioct:Comment\" class=\"comment comment-by-node-author comment-by-viewer clearfix clearfix\">\n\n \n <footer class='node-submitted clear-block'>\n <div class='user-picture'> <div class=\"user-picture\">\n <a href=\"/cruzr/users/admin\" title=\"View user profile.\"><img typeof=\"foaf:Image\" src=\"http://localhost/cruzr/sites/default/files/styles/user-s/public/pictures/picture-1-1306596694.jpg\" alt=\"admin's picture\" title=\"admin's picture\" /></a> </div>\n</div>\n <div class='byline'><span rel=\"sioc:has_creator\"><a href=\"/cruzr/users/admin\" title=\"View user profile.\" class=\"username\" xml:lang=\"\" about=\"/cruzr/users/admin\" typeof=\"sioc:UserAccount\" property=\"foaf:name\">admin</a></span></div>\n <div class='date'>3:22pm Today</div>\n </footer>\n\n <header class=\"title clearfix\">\n <a href=\"/cruzr/comment/213#comment-213\" class=\"permalink\" rel=\"bookmark\">#2</a> <em class=\"unpublished\"></em>\n \n \n </header>\n\n <div>\n <span rel=\"sioc:reply_of\" resource=\"/cruzr/content/review-bard-design-group-inc-admin-0\" class=\"rdf-meta\"></span><div class=\"field field-name-comment-body field-type-text-long field-label-hidden\"><div class=\"field-items\"><div class=\"field-item even\" property=\"content:encoded\"><p>it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>\n</div></div></div> </div>\n\n \n <nav class=\"links comment-links clearfix\"><ul class=\"links inline\"><li class=\"comment-delete first\"><a href=\"/cruzr/comment/213/delete\">delete</a></li><li class=\"comment-edit\"><a href=\"/cruzr/comment/213/edit\">edit</a></li><li class=\"comment-reply last\"><a href=\"/cruzr/comment/reply/212/213\">reply</a></li></ul></nav>\n \n</article>\n<a id=\"comment-214\"></a>\n<article about=\"/cruzr/comment/214#comment-214\" typeof=\"sioc:Post sioct:Comment\" class=\"comment comment-by-node-author comment-by-viewer clearfix clearfix\">\n\n \n <footer class='node-submitted clear-block'>\n <div class='user-picture'> <div class=\"user-picture\">\n <a href=\"/cruzr/users/admin\" title=\"View user profile.\"><img typeof=\"foaf:Image\" src=\"http://localhost/cruzr/sites/default/files/styles/user-s/public/pictures/picture-1-1306596694.jpg\" alt=\"admin's picture\" title=\"admin's picture\" /></a> </div>\n</div>\n <div class='byline'><span rel=\"sioc:has_creator\"><a href=\"/cruzr/users/admin\" title=\"View user profile.\" class=\"username\" xml:lang=\"\" about=\"/cruzr/users/admin\" typeof=\"sioc:UserAccount\" property=\"foaf:name\">admin</a></span></div>\n <div class='date'>3:24pm Today</div>\n </footer>\n\n <header class=\"title clearfix\">\n <a href=\"/cruzr/comment/214#comment-214\" class=\"permalink\" rel=\"bookmark\">#3</a> <em class=\"unpublished\"></em>\n \n \n </header>\n\n <div>\n <span rel=\"sioc:reply_of\" resource=\"/cruzr/content/review-bard-design-group-inc-admin-0\" class=\"rdf-meta\"></span><div class=\"field field-name-comment-body field-type-text-long field-label-hidden\"><div class=\"field-items\"><div class=\"field-item even\" property=\"content:encoded\"><p>zxcvzxcvzxcvzxcv</p>\n</div></div></div> </div>\n\n \n <nav class=\"links comment-links clearfix\"><ul class=\"links inline\"><li class=\"comment-delete first\"><a href=\"/cruzr/comment/214/delete\">delete</a></li><li class=\"comment-edit\"><a href=\"/cruzr/comment/214/edit\">edit</a></li><li class=\"comment-reply last\"><a href=\"/cruzr/comment/reply/212/214\">reply</a></li></ul></nav>\n \n</article>\n\n </div>\n"
Comments
Comment #1
Adam S commentedBecause Views calls drupal_render on the $node->content['comments'] array it can not be worked with in a template file using the hide() function which expects an array while Views has already rendered it as a string. Here is the patch.
Comment #2
Adam S commentedThis little piece of code just doesn't prevent comment form from showing, it prevents all the comments from showing.
Comment #3
dawehnerThe patch itself looks good.
Comment #4
hnln commentedsub
Comment #5
hnln commentedand patch seems to work here 2
Comment #6
dawehnerCommited to 7.x-3.x
Comment #8
ksenzeeFor purely selfish reasons (i.e. drush make) I'm uploading a version of this patch that applies to rc1.
Comment #10
jibranIn the below view, I am unable to see comments attached to node.
And when I change format to Teaser it shows me comments and comment form.
Comment #11
xanderol commentedI'm getting the same thing as #10
The comments will show for teaser but not for full content.
I tried 7.x-3.0 and 7.x-3x-dev
Comment #12
dariogcode commentedSame for me. I tried 7.x-3.1+31-dev
Comment #13
dawehnerHere is a view which works fine for me both on pages and blocks.
I'm pretty sure you have some kind of overlap of two pagers here. Please setup another pager id for the pager in views, as you can't change the one coming from the comments.
Needs review means that there is a real patch attached, which is not.
Comment #14
jibranI have tested the above view. It works fine if format -> show is Content | Teaser but just change it to Content | Full content and it stop showing comments on block display.
Comment #16
mcfilms commentedWas this patch ever rolled into Views 3.x? Currently I have a field View displaying 3 rendered nodes. I also included the field for rendered comments. And finally I set a Relationship of Comment: Comments of the node. (Tried it with and without this relationship.) The comments never seem to display. In fact the only way I have been able to show a comment is to display all the node's fields followed by all the comment's fields.
Is this a known bug or is this pilot error?
Comment #17
dawehner@mcfilms
Yes, see http://drupal.org/node/1194614#comment-4640014
You can do this by displaying comments, choose the relationship to node, and then display both of them.
Comment #18
joshmillerGetting bit by this (see Comment #2) on for showing comments on a block within a view. This was added by @merlinofchaos in #1077632: Views blocks that use the "full node" build mode display incorrectly on the node page and I'm going to post a patch that only checks to see if the node in question isn't a menu_get_object() ... which avoids the problem only if it exists.
Comment #19
derekahmedzai commentedIs there a fix for this?
Like #14 I can only display comments if the format is
Show: Content | Full contentComment #20
joshmillerThe patch was posted here: http://drupal.org/node/1077632#comment-6300058
I did talk to merlinofchaos about this and he said my reverting of the code was a bit drastic and might have bigger complications. We run drupalcommerce.org for thousands of users every day and don't have any odd issues.
Josh
Comment #21
Northern_Girl commentedI ran in this problem with views 3.8. Is there a turnaround solution for this? Maybe by attaching a view of comments? A relationship? I tried different things but just cannont find a way (just not good enough with views...).
Thanks.
Comment #22
Yuri commentedGood question Northern_Girl, Its funny that this issue is still present after three years.
Comment #23
Yuri commented@joshmiller not sure if this has to do with that patch you mentioned in #20. I applied it and comments show up, but The full content view ignores the display settings of the node. For example, I have hidden the title..and it stills shows.
Comment #24
Northern_Girl commentedWell... What I did is : " Show: Content | Tokens ".
So I got everything : complete nodes, tags, links to comments and comments. For the final «tweak» I used CSS and "visibility:none" to hide the tags. So I got some sort of guestbook/collective wall. Now I'm looking for a Rules to unpublish "shouts" that are to old...
NG