I have a drupal 7 site and want to customize the comment form to always be plain text (regardless of the user and whether they are authenticated). As the text format setting will be fixed, I want to remove the little blurb that appears at the bottom of the comment body.
In general, how do I go about customising the look and feel of the comment form?
UPDATE
As per Berdir’s instructions I added an #after_build function. I did this by adding a hook_form_comment_form_alter function to my template.php file. That new function and the custom function it calls are below:
function mytheme_form_comment_form_alter(&$form, &$form_state, &$form_id)
{
$form['comment_body']['#after_build'][] = 'configure_comment_form';
//$form['comment_body']['und']['#after_build'][] = 'configure_comment_form';
}
function configure_comment_form(&$form, &$param1, &$param2)
{
var_dump($form);
}
Clearly I can tell that my configure_comment_form function is getting called as the var_dump gets printed out. I’ve tried adding the configure_comment_form to the #after_build at both the location in the $form array shown in the code. I get identical results for both, the comment body form field simply disappears.
I’ve not overwriting any existing after build functions. $form['comment_body']['#after_build'] does not exist when I add a function to it and $form['comment_body']['und']['#after_build'] looks as below after adding the custom function:
["#after_build"]=>
array(2) {
[0]=>
string(30) "field_form_element_after_build"
[1]=>
string(22) "configure_comment_form"
}
To remove the filters box under the comment body you can use your theme’s template.php to implement the following hooks:
This just leaves the outline of the filter/tips box, and that can be taken care of in your theme’s CSS with:
Although I am not sure if that will cause other functionality to break by hiding that class.