How to change the location of comments in Drupal?
In a D6 site, I want to display the comments made against a node in a specific place in that node's template file, rather than having them added to the page after the end of the rendered node, which is what's happening now. Surely(?) there'开发者_开发百科s a trivial theming-related way to do this that I just haven't stumbled into. Can anyone point me to the obvious solution that has to be out there (or, alternatively, let me know that that solution doesn't exist)? Thanks!
You need to write a variant of node_page_view and node_show then hook_menu_alter the node/% path to it. Put the render comments into some key of $node ($node->comments_rendered) and then use that in the theme. Ask for more if this is not enough. This is fixed big time in Drupal 7 BTW with hook_page_alter().
One answer is to create a view of comments, and then create a block based on the view. You would use an argument to filter the on the nid. Then you could put the block in any editable region you have defined in your theme.
精彩评论