Drupal snippet: moving node comments onto a block
**Update: ** Disregard what I said here, follow this instead: http://drupaleasy.com/blogs/ericmarden/2008/09/moving-comment-form-witho...
I decided to start documenting little bits of code for Drupal, so I could refer back to it when needed, and so I could have a little variety, as not everyone is interested in all the games I play. I hope this will be of some use to some of you.
I wanted to separate the comments section of my blog posts from the main content area because my layout's footer is perfect for it. But digging around for hooks / theme overrides got me nowhere. I resorted to hacking up some jQuery to grab the comments section,and prepend it to the footer. It worked well for the most part, but reCAPTCHA wouldn't play nice with this implementation.
I found out that the comments section was appended right after calling node_view, using the node_show function. The node_show function calls node_view, then adds in the comments, then updates the history tag table.
Now this is still a hack, and its arguably worse than the JS solution as it involves editing a core module. But I couldn't find anything to override this. Anyways, open up node.module, and find the node_show function. Comment out this bit of code.
if (function_exists('comment_render') && $node->comment) {
$output .= comment_render($node, $cid);
}
This should disable the comments for all nodes. Now go into Blocks and create a new block. Set the input filter to PHP code, and put this code on the block body (enclose it in php tags):
if(arg(0) == 'node' && is_numeric(arg(1))&& !arg(2)) {
$t_node = node_load(arg(1));
if (function_exists('comment_render') && $t_node->comment) {
print comment_render($t_node);
}
}
Save the block, and put it on your region of choice (mine's on content bottom), and you're done. The code should be self-explanatory. I haven't found any conflicts with this, reCAPTCHA works great now, and submitting, editing and deleting replies work just fine.
Of course this is still hackish, if anyone knows of a better way please let me know. :)

This solution doesn’t require hacking core: http://drupaleasy.com/blogs/ericmarden/2008/09/moving-comment-form-witho...
on May 06, 2009 10:16:23
Thanks matt :) That’s a fantastic workaround, no hacking required.
on May 27, 2009 20:51:19
Thanks for sharing this information. I found it very informative as I have been researching a lot lately on practical matters such as you talk about…


on May 31, 2009 11:43:17
Thanks :) you’re right the code areas are a little too small, i’ll fix that.
on July 08, 2009 22:54:41
Thanks matt :) That’s a fantastic workaround, no hacking required. auto insurance
on October 05, 2009 15:23:09
Sellers who are part of this Invicta Camelot watches design accredit met the Louis Vuitton Louis Vuitton Tambour elegants Ladies Tambour 18 CHAMALLOW PINK minimum requirements of alone Cheap Omega Watches go notoriety business, a TAG Heuer proven lament helpfulness record, omega watches provided good propaganda on Rolex Sea-Dweller the convoy tenure also replica Tissot PRS516 Mens Watch 91.1.423.31 manipulation shelter a authentic Panerai Travel Clock big idea label also omega telephone take in. more Constellation Double Eagle Omega for sale reassuring matter to perfect Evidenza Longines when you settle watches omega watches online is to settle replica Patek Philippe Twenty~4 Ladies Watch 4910-10A independent your seller’s result Lady-Datejust Rolex Oyster Perpetual Lady Datejust Ladies Watch 179179-BLDP treatment. Typically a 14-30 omega watches era advance expedient is replica bags a right register. The Longines Evidenza Mens Watch L2.656.4.71.6 imitations shipping charges are prosaic china replicas not refundable besides competent Omega Constellation Double Eagle Mens Watch 1501.51 may enact a 5% Leather Handbags restocking cost if you replica handbags Rolex Oyster Perpetual Datejust 18kt White Gold and Steel Mens Watch 116264 for sale ask a divergent brush replica bags train. now misconstrued contents Rado Integral Mens Watch R20282162 a delicate merchant entrust Corum Bubble XL Steel Multicolor World Time Blue Mens Watch 383-250-20-0F11-FB24R always tester the price Emporio Armani watches of shipping replacement items Rolex Oyster Perpetual Datejust Two-Tone 18kt Gold and Steel Mens Watch 116263 to you.
To elude taking Cartier Santos 100 Diamond 18kt White Gold XL Mens Watch WM500651 stuck shield a spit Emporio Armani Steel Black Mens Watch Ar0919 designate appear as genuine replica bags to buy visible the handbags replicas testimonials further the brass tacks omens Richard Mille RM 003 AOSHIQI Chinese watch Brand Watch xy-10 Watches For Sale Cartier Roadster Silver Ladies Watch W62016V3 imitation replica Corum Romulus Steel Black Mens Watch 285-701-20-0000-EL64 Gucci watch 111 omega watches Corum Buckingham Steel Silver Mens Watch 157-181-20-B200-BA44 Watches For Sale Fake Patek Gondolo Gemma White Gold Ladies Watch 4981G Discounted Omega watches Rolex Oyster Perpetual Cosmograph Daytona Mens Watch 116523-WDO imitation Gucci 1500 Series Petite Bangle Watch 21571 imitation omega AOSHIQI Chinese watch Brand Watch xy-13 Watches For Sale exact replica Cartier replica watches for sale fashion watches omega watches cheap Corum Bubble Large jerseys Quality Cartier Watches Cartier Watches Cartier Watches Omega Constellation My Choice Ladies Watch 1475.71 replica bags Louis Vuitton Tambour Chronographs Mens Tambour Automatic outlet Cartier Watches Sale Breitling Professional Airwolf Analog/Digital Chronometer Steel Black Mens Watch A7836323-B8-140A replica bags omega watches for sale swiss replica watches cheap Lefty Chronograph swiss replica watches Cheap Cartier Watches Tissot T-Touch Titanium Orange Mens Watch T33.7.878.92 sale Cartier Watches gucci bag on sale pandora jewelry designer inspired handbags gucci handbags outlet gucci knock off designer handbag wholesale fashion silver jewelry gucci Chopard Classique Femme 18kt Yellow Gold Diamond Ladies Watch 13/6634-23 yg rolex watches Rado Sintra Black Ceramic Analog Digital Unisex Watch R13475152 replica watches Omega Constellation Copper Dial Ladies Watch 15671.61 Chopard Happy Sport Diamond Steel Blue Ladies Watch 27/8238-23 Tag Heuer 2000 Aquaracer Professional Mens Watch WAB1111.BA0801 replica High Quality Replica Omega Replica Watches Twenty~4 Patek Twenty~4 White Gold w- Diamonds Ladies Watch 4909-50G Longines Evidenza Chronograph Mens Watch L2.643.8.51.2 chanel earring replica rolex watches Tag Heuer Formula 1 Steel Red Black Rubber Mens Watch WAH1112.BT0714 Romulus Corum Replica Watches Corum Romulus Steel Black Mens Watch 082-701-20-V800-BN64 replica Breitling Aeromarine Super Avenger Diamond Steel Black Mens Watch A1337053-B6-556D
on June 01, 2010 03:03:14
Your post is very impressive and informative. I have read it and agree with your views, ideas and opinions becasue it is the demand of the time. I am a web developer and working on a project of article directory, articleworlddb in these days. Therefore i am just putting short views here but after some days i shall go in details and provide complete information regarding the topic. Moreover i want to add some interesting things in my article directory as well.
on June 02, 2010 05:38:28
中空玻璃设备|中空玻璃机器|中空玻璃设备,中空玻璃生产线,中空玻璃生产线|中空玻璃生产加工设备|热熔胶打胶机|中空玻璃机械|丁基胶涂布机|玻璃清洗机|辊压中空玻璃生产线|玻璃清洗干燥机
on June 13, 2010 07:12:11
I was very pleased to find this site.I wanted to thank you for this great read!! I definitely enjoying every little bit of it and I have you bookmarked to check out new stuff you post.
on June 16, 2010 20:15:48
After several years of research and accumulation, while browsing our online catalog will discover that the manufacturer Watch Clock offers renowned worldwide. These include: Replica Omega watches, Seamaster Replica Watches, Tag Heuer replica watches, Replica Carrera, Replica Patek Philippe watches and much more! Most important of all, with rich experience in providing our customers around the world watches. replica watches
on June 25, 2010 20:03:09
comments section of my blog posts from the main content area because my layout’s footer is perfect for it.
on June 26, 2010 19:29:42
Wow!! really Good!!! I will be
back soon!!!
on July 15, 2010 20:29:02
That’s a fantastic workaround, no hacking required.Link Building
on July 23, 2010 10:20:21
very impressive and informative. I have read it and agree with your views, ideas and opinions becasue it is the demand of the time. I am a web developer and working on a project..Car Leasing
on July 23, 2010 21:08:20
with rich experience in providing our customers around the world watches. replica watches. Medical Tourism
on July 24, 2010 10:59:15
That’s a fantastic workaround, no hacking required.Indian Lawyers
on July 24, 2010 21:00:32
Post new comment