Community Documentation

Field Types and Settings

Last updated February 1, 2013. Created by pearlbear on January 4, 2013.
Edited by jaskho, DanChadwick. Log in to edit this page.

There are a defined number of field types in use, and each type has its own available settings (link is to API list_info).  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.

Comments

link is to API list_info I am

link is to API list_info

I am somewhat prone to being dense, but I can't decipher this.

nobody click here