1

Before anyone suggest the Comment Form Above Comments, I have already tried that it did not work.

Honestly there seems to be amazingly little documentation on this issue, given that comment form above the comments is so standard on many sites now a days I would figure there would be a simple button to click to make this happen.

This leads me to believe that either there is a simple solution that I am completely missing or there is no way to do this and I am doomed. Me I am hoping for the first one.

I have a blog site... I read about altering the core code of the comments module, but I have also heard that it is bad practice to alter the core code. So if there is another solution out there available to drupal 7 I would appreciate it.

  • when you say "Before anyone suggest the Comment Form Above Comments, I have already tried that it did not work." what do you mean? have you tried in the node.tpl.php? – Mohammed Shameem Jan 24 '13 at 17:52
7

I think you should copy modules/comment/comment-wrapper.tpl.php to your theme and change it there. The file is pretty much self explanatory. Hope it's helpful.

6

I am not sure what you mean by

Before anyone suggest the Comment Form Above Comments, I have already tried that it did not work.

But the following works for me.

In node.tpl.php I printed the form in the following order

  <?php print render($content['comments']['comment_form']); ?>

  <?php print render($content['comments']); ?>

The form and the comments are contained with in the variable $content['comments'] so when you render this variable it does so with both the comments as well as the comment form. The comment form is found with in the variable called $content['comments']['comment_form'] so if you render this one first it would be removed from the array and wont be rendered in the subsequent call to the render function.

Please see it in action in below image

enter image description here

  • There is a module by that name, should have been more specific about it. Mine is not in there at all... I use the Omega theme, I have a comment.tpl.php, but it doesnt have the code you referenced above. I checked the node.tpl.php and it doesnt have the code in their either. Any thoughts? – amiller Jan 24 '13 at 18:27
  • hope this worked for you.. – Mohammed Shameem Jan 24 '13 at 18:29
  • Omega does have the comments in node.tpl.php. it would be towards the end of it. you would only see <?php print render($content['comments']); ?> I have edited the answer with an explanation – Mohammed Shameem Jan 24 '13 at 18:36
  • Did that help you out? – Mohammed Shameem Jan 24 '13 at 18:49
  • Sorry for not responding back was gone for the weekend... yea that helped. thanks a lot – amiller Jan 28 '13 at 6:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.