O'Reilly logo

Drupal 7 Theming Cookbook by Karthik Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Styling the comment form

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.

Getting ready

We will be using the mysite module created earlier in this book to contain an implementation of hook_form_alter(). As 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 at ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required