O'Reilly logo

Drupal 6 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

Reordering 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 feature to reorder fields in a typical node form with the aim of giving greater prominence to the body field and less to the menu and category fields.

Getting ready

We will be using the mysite module created earlier in this book to contain our hook_form_alter(). It is also recommended that the Devel module be enabled to help with diagnostic prints and other debugging efforts.

How to do it...

Navigate to the mysite module folder at sites/all/modules/mysite to perform the following steps:

  1. Locate the file mysite.module and open it in an editor.
  2. Scroll down to the bottom ...

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