Hello,

Is there any place to put comment submission guidelines in? People do not seem to realise the comments are threaded and they just reply to any comment in under the whole thread.

Also, it is very difficult to move the comment after they have posted it. If they reply to a comment when it is obvious they wanted to reply to the oroginal post then I can move it but I have to fiddle a lot with the database. It would be great to have a field in the "edit comment" where I can change the comments parent.

Any suggestions would be much appriciated.

Best regards,
Brett

Comments

silverwing’s picture

I need to add a line of text to my comment submission form (just to say that I have an over-active spam filter ;0)

Is the only way to do that to edit my comment.module file? (I couldn't find a comment submission guideline file in 4.6, but I thought I saw one earlier... am I mistaken?)

silverwing

www.misguidedthoughts.com

Christefano-oldaccount’s picture

There's a way to do this by overriding the comment form in the theme layer. You don't have to edit the comment.module.

Add this to your template.php file:

/**
 * Display posting guidelines at the top of comment submission forms.
 * It is useful for helping or instructing your users.
 */
function phptemplate_comment_form($form) {
  $output .= '<div>';
  $output .= '<div class="comment_help">Comment guidelines go here.</div>';
  $output .=  drupal_render($form);
  $output .= '</div>';
  return $output;
} 

I've written up a more elaborate tutorial that allows editing of the comment guidelines from within Drupal (instead of editing the template.php file on the server). Check my drupal.org profile for a link to my Drupal development column.

Sborsody’s picture

Note that the above code doesn't work in Drupal 6.x. Anyone know how to get this working for Drupal 6.x?

Sborsody’s picture

I'm doing this from inside a custom module. It can probably be done inside a theme's template.php too. There may be other ways. I'm just a Drupal hacking newbie. Also check out "Theming forms" at http://api.drupal.org/api/file/developer/topics/forms_api.html

function mymodule_theme() {
  return array(
    'comment_form' => array(
      'arguments' => array('form' => NULL),
    ),
  );
}

function theme_comment_form($form) {
  $output = '';
  $output .= '<div class="comment-help">Comment guidelines go here.</div>';
  $output .=  drupal_render($form);
  return $output;
}
bflora’s picture

This gives me the white screen of death.

Do I paste it into the template file as is, or does the "phptemplate" bit need to be changed to something else?