1

Is there a simple way to move the comment form above the comments in Drupal 6?

2

You can use the Comment form above comments module which adds option to place comment form above the comments thread.

  • Haha, what an aptly named module. – rooby May 5 '13 at 10:11
0

This is a very simple thing to do in your theme so if you don't want to install another module just to do it you can override the comment-wrapper.tpl.php template file in your theme.

Just copy that file to your theme from the comment module (or if your theme is a sub-theme you there might be one in your base theme, in which case use that one - in this case the example coe below may not exactly match your base theme's code).

Then move this part:

<?php if ($content['comment_form']): ?>
  <h2 class="title comment-form"><?php print t('Add new comment'); ?></h2>
  <?php print render($content['comment_form']); ?>
<?php endif; ?> 

So it is where you want it. In this case probably just above the line:

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

You can do this for a specific node type by renaming the file to comment-wrapper--node-NODETYPE.tpl.php, where NODETYPE is replaced with the machine name of your content type (with any underscores changed to dashes).

-1

The simplest way I found was with CSS Note: I only want to do this with a specific Content type with the class ".node-chat-with-a-character" the height/padding of 200px was specific to my solution, and was a number I arrived at after removing a lot of extraneous things from the comment form.

/*put comment submit above comments*/

.node-chat-with-a-character #comments { position: relative; padding-top: 200px; }

.node-chat-with-a-character #comments .comment-form{ position: absolute; height: 200px; top: 0px; }

-1

Put this in a block; it is the best and easiest method.

<script type="text/javascript">
  $(function(){
    $('.box').prependTo('#comments');
  });
</script>
  • How is this the best method? You've got code in a block for starters - this is the start of a downward spiral to a totally unmanageable site. – Chapabu May 5 '13 at 21:47

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.