Field Types and Settings
Drupal 7 will no longer be supported after January 5, 2025. Learn more and find resources for Drupal 7 sites
There are a defined number of field types in use, and each type has its own available settings (links below are to API HOOK_field_info() implementations). The settings array can appear in three places: the field definition, in instance definition, or within the instance definition's widget array.
List of field types:
- file (File)
- image (Image)
- taxonomy_term_reference (Term Reference)
- List fields
- list_boolean (Boolean)
- list_float (List (Float))
- list_integer (List (Integer))
- list_text (List (Text))
- Field settings
- allowed_values (list_integer, list_float, list_text only.)
- allowed_values[on] and allowed_values[off] (list_boolean)
- Widget
- settings[display_label] (options_onoff i.e. checkbox only)
- Number fields
- number_decimal (Decimal)
- number_float (Float)
- number_integer (Integer)
- field settings
- precision (number_decimal only)
- scale (number_decimal only)
- decimal_separator (number_decimal and number_float only)
- Text fields
- text (Text)
- text_long (Long Text)
- text_with_summary (Long Text with Summary)
- Field settings
- max_length. For unlimited textareas, set to ''
- Instance settings
- text_processing (enables text filters)
- Widget
- settings[size] (textfield only)
- settings[summary_rows] (textarea_with_summary only)
- settings[rows] (textarea)
- All fields
- label
- required
- description (known as help text in the ui)
- default_value[][value]
- settings[description] ('help' text)
To discover settings, search the Drupal API for implementations of hook_field_settings_form. To discover widget options, search for implementations of hook_field_widget_form. This is very difficult to document because the code is distributed through a handful of modules, each with multiple relevant hooks to examine.
Help improve this page
You can:
- Log in, click Edit, and edit this page
- Log in, click Discuss, update the Page status value, and suggest an improvement
- Log in and create a Documentation issue with your suggestion
Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.