rowan.t
rowan.t

Reputation: 187

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.

Upvotes: 5

Views: 2756

Answers (2)

Clive
Clive

Reputation: 36956

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));

Upvotes: 5

jsheffers
jsheffers

Reputation: 1622

Use the following code in your page.tpl.php

<?php print render($content['comments']);?>

Upvotes: 0

Related Questions