Field Formatter API

You are here

  1. 7 modules/field/field.api.php field_formatter
  2. 8 core/modules/field/field.api.php field_formatter

Define Field API formatter types.

Field API formatters specify how fields are displayed when the entity to which the field is attached is displayed. Fields of a given field type may be displayed using more than one formatter. In this case, the Field UI module allows the site builder to choose which formatter to use. Field formatters are defined by implementing hook_field_formatter_info().

See also

Field API

Field Types API

Field Widget API

Functions

Namesort descending Location Description
hook_field_formatter_info modules/field/field.api.php Expose Field API formatter types.
hook_field_formatter_info_alter modules/field/field.api.php Perform alterations on Field API formatter types.
hook_field_formatter_prepare_view modules/field/field.api.php Allow formatters to load information for field values being displayed.
hook_field_formatter_view modules/field/field.api.php Build a renderable array for a field value.

File

modules/field/field.api.php, line 1014

Comments

hook_field_formatter_settings_form() : Specify the form elements for a formatter's settings.

hook_field_formatter_settings_summary()***: Return a short summary for the current formatter settings of an instance.

***If an empty result is returned, the formatter is assumed to have no configurable settings, and no UI will be provided to display a settings form.