Title says it all. Thanks to chx's pointer, this makes use of another cool feature of the new menu system: menu_get_object().
Attached patch does the ground-work. However, it's likely that users will use the same variable name for the block region in their page template, i.e. $comments, which would lead to a situation where the page variable overrides the region variable.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | comment_display.block_.patch | 3 KB | sun |
| #1 | comment_display.block_.patch | 2.08 KB | sun |
| comment_display.block_.patch | 1.91 KB | sun |
Comments
Comment #1
sunNow prevents overriding a 'comments' region if that already exists.
Comment #2
drupaloSa commentedvery handy module, thanks.
Comment #3
sunI'm unsure whether I'm satisfied with this approach. Having comments in a block is definitely a benefit, but this leads to having a block title and the title for adding a new comment on different levels. Ideally, both the comments and the new comment form should be separate blocks - or - the output of comment_render() is altered in a way that the list of comments uses identical markup to output a "Comments" title above all comments, so a themer can style "Comments" and "Add new comment" accordingly.
Comment #4
sunHere we go. This patch introduces a separate "Comment form" block that can be placed below the "Comments" block. Of course, this makes only sense when the comment form is configured to be displayed on a "separate page" - otherwise, the form is displayed twice on the node view.
Anyone available for testing?
Comment #5
roborn commentedThanks for this feature. I'm using it with Ajax Comments + Quicktabs and everything is working ok :)
Comment #6
el7cosmoscomment form appear in node type that disabled comments.
Comment #7
sunThanks for reporting, reviewing, and testing! Committed that patch including a quickfix for aforementioned bug.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Comment #9
iori57 commentedI'm testing the 6.x-1.x-dev dated 2010-Apr-17 but I found that the comment block's CSS does not work..
However if manually adding
<?php print $comments; ?>, the CSS works perfectly =)Some bug in the blocks?
By the way this module is awesome! Finally able to split the comments from the node! Thanks!! :)