By gprestwood on
I am trying to hide most of the fields in my comment form. I am trying to end up with just the "Add new comment" label, the text box, and the submit button. A combination of the Better Formats and Display Suite modules accomplish most of this, but two fields are left that can't be removed by them:
- The comment author ("Your name")
- The "Comment:*" label above the text box
I found an article explaining how to remove these in Drupal 6 (here) and using the same approach I created a simple module that successfully hides the "Your name" line.
function mymodule_form_comment_form_alter(&$form, &$form_state) {
$form['author']['#access'] = FALSE;
}
However, I am not able to hide the "Comment:*" label. Any ideas?
Comments
This is better done through
This is better done through CSS:
(this is for Bartik, may need something different for other themes)
The reason for not doing this in code is that comment body is a required field, and if you managed to remove the title from it, you'd end up with a mysterious red asterisk hanging there. :)