Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to render the comment thread in drupal 7

I have created a custom content page.tpl.php file and I am trying to display the whole comments section. So far I have been apply to display the beginning of the comments section where the user can enter comments but it is not printing the comment thread. The code I am using to print the comments is

<?php print drupal_render(drupal_get_form("comment_node_{$node->type}_form", (object) array('nid' => $node->nid))); ?>

but this does not display the comment thread, just the form.

like image 834
rowan.t Avatar asked Nov 21 '12 14:11

rowan.t


1 Answers

It'd probably be best to make use of comment_node_page_additions():

Build the comment-related elements for node detail pages.

e.g.

$rendered = render(comment_node_page_additions($node));
like image 163
Clive Avatar answered Oct 18 '22 01:10

Clive