The way that comments are appended after a node render makes it difficult for a themer to position comments where'd they would like them. This patch just makes it possible for a themer to override the default behavior.

I've read some threads where some complex changes are being proposed- this is a stop gap measure.

CommentFileSizeAuthor
#4 themable_node_show.patch3.34 KBpancho
patch_138.txt1.34 KBarthurf

Comments

arthurf’s picture

Status: Active » Needs review

Woops, give this the wrong status

jlambert’s picture

Seems like a no brainer. Patch looks good without trying it.

dmitrig01’s picture

Version: 5.1 » 6.x-dev
Priority: Normal » Minor
Status: Needs review » Needs work

this needs to use the theme registry. Also, eaton is on the job (issue # not handy ATM) && features don't get into 5.1

pancho’s picture

Category: feature » task
Priority: Minor » Normal
StatusFileSize
new3.34 KB

Eaton's reworked node rendering is on #134478, but is scheduled for D7.
For D6 this Stop gaps measure is just right. I reworked the original patch:

  • Renaming the function from theme_node_show() to theme_node_page().
  • Properly using the theme registry
  • Making $cid a truly optional parameter
  • Renaming the flag $message to a more meaningful $revision.
  • Adding node_show() as a legacy wrapper to prevent breaking the API for contrib.
  • Making poll_results() use the new themeable function.
  • Adding complete phpdoc.

Did some basic tests ensuring nothing is broken. Didn't test the themeability though. Maybe someone could do that...

pancho’s picture

Status: Needs work » Needs review
pwolanin’s picture

well, I'm in favor of this as a stop-gap, since the hard-coded behavior of appending the rendered comments is just wrong and inflexible.

moshe weitzman’s picture

Status: Needs review » Closed (duplicate)
spiffyd’s picture

Any documentation as to how one can reposition the comments and comments form after applying the patch?

j0rd’s picture

BOOOO. This sucks. Troll.

Sorry, just frustrated with this 3 year old "bug". Anyone have any reasonable solutions. or am I hacking core at this point?

arthurf’s picture

FYI, you can get around this issue by doing something like:
<?php
function custom_preprocess_node(&$vars, $hook) {
// You will need to set some conditions for when you want to do this
if ($vars['node']->comment) {
$vars['comments'] = comment_render($node);
// Now we unset the comments so that comment_render() is not called in node_show()
unset($node->comment);
}
}