Closed (duplicate)
Project:
Drupal core
Version:
6.x-dev
Component:
node.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2006 at 16:12 UTC
Updated:
24 Dec 2008 at 21:45 UTC
Attached you'll find a small patch which introduces a new node-settings to switch the inclusion of comments off or on. If you turn off the switch, you'll have to load the comments explicitly via comment_render().
The patch should apply against drupal-HEAD.
I am a bit unsure about my solution, ideally there should be no comment-related code in node.module, and the setting should reside under admin/comments/configuration.
I am in the need to split comments from the node-output, so I can display the comments where I want.
What do you think?
| Comment | File | Size | Author |
|---|---|---|---|
| node_module_patch | 999 bytes | stmh |
Comments
Comment #1
markus_petrux commentedMaybe you could do what you need using the Views module?
Comment #2
stmh commentedI didn't try the views.module, and perhaps it is a suitable solution to get a list of comments, but this does not resolve the output of comments as part of the node_show-method e.g. when viewing a particular node.
Comment #3
moshe weitzman commentedThe simplest patch would be to move comments to be rendered into a block and then place the block into the 'footer' block region by default. The block would only actually output something if we were viewing a node with comments.
I made this comment_redenr() optional and much more in this patch - http://drupal.org/node/24804. It needs some updating before being considered for core.
Comment #4
stmh commentedHi,
I reviewed your patch before posting mine, and indeed it does mostly the same. But I want more flexibility, I don't want to render the comments in a separate tab, perhaps I want to render the comments on a separate page, perhaps I want a completely different layout of comment-creation and -displaying.
With HEAD this is not possible, even with your patch it is not possible right of the box.
The only thing my patch does, is to suppress the comments when showing the node. So the developer can decide how and where the comments should be displayed.
As a theme-developer it is hard to break drupal's output-paradigm without hacking core. And this is the last I want to do.
For displaying comments in a separate tab it is not needed to patch core in that way. You can code a small module which adds the menu-item and the callback-function which calls comment_render. The only patch you'll need is mine ;)
What do you think of that idea?
Comment #5
Jaza commentedI don't think that either this patch (adding a new config option), or moving comments into a 'footer block', is the right solution for drupal 6. Probably the best solution - now that the node body is constructed from a structured array - would be to add the comments as an element to the node body. Users can then override this element in a contrib module if they want to.
Comment #6
FiReaNGeL commentedStumbled upon this issue today - as of now, the comments section can't be moved where I want to, its always at the end of the node. The only solution so far involve hacking the core : http://drupal.org/node/122240#comment-272809
Is is too late to get a way to display comments where we want to in node.tpl.php?
Comment #7
FiReaNGeL commentedMore descriptive title
Comment #8
gollyg commented+1 for jazas approach (adding the comments to the node->content array).
It makes logical sense to move the placement of comments into the node theming process. Whilst most people will be happy with comments at the end of the post, why deny the flexibility.
Using blocks seems to move node content/functionality into a supplementary area.
As a makeshift solution for 5, you can simply add the results of comment_render to your phptemplate variables to make them available to your node template file.
You still need to disable comments in core. Urghh.
Comment #9
moshe weitzman commentedI implemented Jaza's suggestion - #350984: Kick comment rendering out of node module