Field Types and Settings

Last updated on
14 October 2016

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

Page status: No known problems

You can: