Modifying and Overriding Form Functions
The key to obtaining flexibility in the theming of Drupal forms lies in the creation and manipulation of theme functions specific to a particular form. As already noted, the forms have few pre-existing themeable functions. There are some exceptions, for example the generic functions found in forms.inc
, and the dedicated functions for the Search Forms and the Polls module, but by and large the theming of forms must be accomplished without the benefit of dedicated themeable functions.
To get control over what is happening inside the form—the fields, the data labels, etc.—you have to create your own overrides to modify specific elements of the form function in question.
Note
For basic changes to the styling of a form, you may not need to create a new function; you may be able to achieve your goals through manipulation of the default styling in the CSS, as discussed below.
It is possible to create overrides and make modifications to the various form functions...