Posted By

picxelplay on 11/16/10


Tagged

forms comment drupal


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

AllKnightAccess


Drupal alter comment form


 / Published in: PHP
 

  1. /**
  2. * Implementation of HOOK_theme().
  3. */
  4. function THEMENAME_theme() {
  5. return array(
  6. 'comment_form' => array(
  7. 'arguments' => array('form' => NULL),
  8. ),
  9. );
  10. }
  11.  
  12. // theme the comment form
  13. function THEMENAME_comment_form($form) {
  14. // Make the text-area smaller.
  15. $form['comment_filter']['comment']['#rows'] = 5;
  16. // Change the text-area title
  17. $form['comment_filter']['comment']['#title'] = t('Your message');
  18. // Remove input formats information.
  19. $form['comment_filter']['format'] = NULL;
  20. // Removes homepage field
  21. unset($form['homepage']);
  22. // Removes preview button
  23. unset($form['preview']);
  24. return drupal_render($form);
  25. }

Report this snippet  

You need to login to post a comment.