I need to add a new form right above the comment form (the form for users to post comments), and below the list of comments.

If I override the comment_form template, I get nested forms which don't work on all browsers.

I tried to override the comment_wrapper template, but I haven't found good documentation on this and so far all my attempts have been futile, as it receives the whole string of HTML (list of comments+comment form) as its input rather than an array or something I can easily manipulate.

Could anyone help me, please?

Thanks in advance.

Comments

GabiAPF’s picture

I've found a solution by overriding the box template instead.

tille’s picture

Hi Gabi,

I'm basically looking for the same - found out about some rewrite - but it places the text between the box title ("add a comment") and the actual box/form..


function phptemplate_comment_form($form) {
  $output .= 'this is shown<div>';
  $output .= '<div class="comment_help">'. t('and this is also shown') .'</div>';
  $output .=  drupal_render($form);
  $output .= '</div>';
  return $output;
}

I would instead love to see my text between the last comment and the box title ("add a comment").. - ..help..?

..thanks!! ..greetz! till..

___________________________
my pictures: www.bilderbook.org

___________________________

GabiAPF’s picture

You can try including this code in the file box.tpl.php:

  $output .= 'this is shown<div>';
  $output .= '<div class="comment_help">'. t('and this is also shown') .'</div>';
  $output .= $content;
  $output .= '</div>';
  echo $output;
dvessel’s picture

FYI, box.tpl.php is used in many places, not just for comment forms. Better way would be to override the comment form and add it through there.

phptemplate_comment_form($form) {
  $output = 'this is shown';
  $output .= 'yadda-yadda';
  $output .= drupal_render($form);
  return $output;
}

Something like that.

edit: oops, tille already mentioned this. :)

joon park