Drupal 7 Get Comments Of Node
Is there an easy way to get the comment开发者_StackOverflows of a node programmatically in Drupal 7?
Check out the function comment_get_thread(), it may be of use to you.
If you don't want to write a code then you can override the node with The panel's node template and by creating a variant in it you can add comment thread in the variant. And I think it is very easier way to do this.
In Drupal 7 you can use the below code to get all the comments of a node using node ID
$nid = 2; // node ID
$comments = db_select('comment')
->fields('comment', array('name','subject'))
->condition('nid', $nid, '=')
->execute()
->fetchAssoc();
foreach($comments as $comment) {
print your comments here
}
In Drupal 6 you can use the comment_render() ;
精彩评论