In this recipe, we will look at manipulating form elements and markup using the Form API in an effort to make styling elements of the comment form easier. To be precise, we will be altering the comment form displayed to anonymous users in order to position its contact fields within a
DIV block, thereby allowing us to target them better via CSS.
We will be using the mysite module created earlier in this book to contain an implementation of
hook_form_alter(). Since we are going to be working on the comment form, it is assumed that the Comment module is enabled.
Drupal's default permissions do not permit anonymous users to view or add comments. These permissions can be added via the Permissions management page ...