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

Theming form elements from a module

Drupal form elements such as checkboxes and radio buttons are all rendered using the theme system and consequently, can be overridden just like any other theme function. In this recipe, we will be adding a new feature to the FIELDSET element by overriding theme_fieldset(). We will be demonstrating its use by adding a postscript to the Revision information fieldset present in every node form.

Getting ready

This recipe requires the use of the mysite module created earlier in this book. The Devel and Theme developer modules will also be used to identify the theme function to override.

How to do it...

Firstly, we need to identify how Drupal is going about theming a fieldset. The recommended method of doing so is to ...

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