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

Reorganizing fields in a form

The Form API, like many other components of Drupal, provides options to order form elements through the use of weights. In this recipe, we will exercise this and other features to reorganize the structure of a typical node form.

Getting ready

We will be using the mysite module created earlier in this book to contain our hook_form_alter(). Fields provided by the Menu module will be among those that we will be looking to tweak and it is therefore assumed that the module is enabled.

It is also recommended that the Devel module be enabled to help with diagnostic prints and other debugging efforts.

How to do it...

In this recipe, we are going to look to restructure the vertical tabs present at the bottom of every node form. ...

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