Field Types API

Define field types, widget types, display formatter types, storage types.

The bulk of the Field Types API are related to field types. A field type represents a particular type of data (integer, string, date, etc.) that can be attached to a fieldable object. hook_field_info() defines the basic properties of a field type, and a variety of other field hooks are called by the Field Attach API to perform field-type-specific actions.

See also

hook_field_info().

@see hook_field_info_alter().

See also

hook_field_schema().

@see hook_field_load().

See also

hook_field_validate().

@see hook_field_presave().

See also

hook_field_insert().

@see hook_field_update().

See also

hook_field_delete().

@see hook_field_delete_revision().

See also

hook_field_sanitize().

@see hook_field_is_empty().

The Field Types API also defines two kinds of pluggable handlers: widgets and formatters, which specify how the field appears in edit forms and in displayed objects. Widgets and formatters can be implemented by a field-type module for it's own field types, or by a third-party module to extend the behavior of existing field types.

See also

hook_field_widget_info().

@see hook_field_formatter_info().

A third kind of pluggable handlers, storage backends, is defined by the Field Storage API.

Functions

NameLocationDescription
hook_field_deletemodules/field/field.api.phpDefine custom delete behavior for this module's field types.
hook_field_delete_revisionmodules/field/field.api.phpDefine custom delete_revision behavior for this module's field types.
hook_field_formatter_infomodules/field/field.api.phpExpose Field API formatter types.
hook_field_formatter_info_altermodules/field/field.api.phpPerform alterations on Field API formatter types.
hook_field_formatter_prepare_viewmodules/field/field.api.phpAllow formatters to load information for multiple objects.
hook_field_infomodules/field/field.api.phpDefine Field API field types.
hook_field_info_altermodules/field/field.api.phpPerform alterations on Field API field types.
hook_field_insertmodules/field/field.api.phpDefine custom insert behavior for this module's field types.
hook_field_is_emptymodules/field/field.api.phpDefine what constitutes an empty item for a field type.
hook_field_loadmodules/field/field.api.phpDefine custom load behavior for this module's field types.
hook_field_prepare_translationmodules/field/field.api.phpDefine custom prepare_translation behavior for this module's field types.
hook_field_presavemodules/field/field.api.phpDefine custom presave behavior for this module's field types.
hook_field_sanitizemodules/field/field.api.phpDefine custom sanitize behavior for this module's field types.
hook_field_schemamodules/field/field.api.phpDefine the Field API schema for a field structure.
hook_field_updatemodules/field/field.api.phpDefine custom update behavior for this module's field types.
hook_field_validatemodules/field/field.api.phpDefine custom validate behavior for this module's field types.
hook_field_widgetmodules/field/field.api.phpReturn a single form element for a field widget.
hook_field_widget_errormodules/field/field.api.phpFlag a field-level validation error.
hook_field_widget_infomodules/field/field.api.phpExpose Field API widget types.
hook_field_widget_info_altermodules/field/field.api.phpPerform alterations on Field API widget types.
theme_field_formatter_FORMATTER_MULTIPLEmodules/field/field.api.phpTheme function for a field formatter.
theme_field_formatter_FORMATTER_SINGLEmodules/field/field.api.phpTheme function for a field formatter.
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.