This one uses simple block or additionally views having more control.

http://drupal.org/project/commentsblock

Comments

SolomonGifford’s picture

e-anima,

There are two differences between our modules.

1.) In terms of performance, this module does not redraw the comments - before it does the following unset, it caches the comments into a static variable for use in the block.

unset($node->content['comments']); 

2.) This module also moves the links associated with the comments.

 unset($build['links']['comment']);

I would be more than happy to remove this module if those two things are addressed in yours. That said, let me admit that I looked but couldn't find yours before I wrote this - otherwise, I would have offered a patch to your module instead of writing this one. The views support yours offers is obviously missing in mine.

marcoka’s picture

ok nice. maybe we can merge one day :)

marcoka’s picture

i started implemnting your approach, seems better just caching the rendered comments.
i have one question about the

function comment_block_static_comments($nid, $build = false, $node = false)

when is the else entered, meaning under what circumstances is $build not TRUE

 if ($build) {
    $comments[$nid]['links'] = $build['links']['comment'];
    $comments[$nid]['comments'] = $build['comments'];
  } else {
    #normal behavior will be that the node calls this function before
    if (!isset($comments[$nid])) {
      $comments[$nid]['links'] = '';
      $comments[$nid]['comments'] = comment_node_page_additions($node);
    }
    return $comments[$nid];
  }
SolomonGifford’s picture

See line 29.

marcoka’s picture

lol. no thats not what i meant.
yes the blocks content is filled like this

$block['content'] = drupal_render(comment_block_static_comments($node->nid, false, $node));

and then there is also
comment_block_static_comments($build['#node']->nid, $build);
inside commentsblock_node_view_alter

lsolesen’s picture

Title: Alternative/Duplicate » Merge with commentsblock

Why not merge these two modules? The difference is really small?

SolomonGifford’s picture

Issue summary: View changes

I have not reviewed their version 2 they have released, but it may satisfy the performance reasons for which I created this one.

SolomonGifford’s picture

Status: Active » Postponed (maintainer needs more info)
SolomonGifford’s picture

Status: Postponed (maintainer needs more info) » Closed (works as designed)

I placed a note on the home page of this module to address this case.