function hook_field_formatter_info

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 field.api.php hook_field_formatter_info()
cle7 field.api.php hook_field_formatter_info()
elmsmedia7 field.api.php hook_field_formatter_info()
icor7 field.api.php hook_field_formatter_info()
meedjum_blog7 field.api.php hook_field_formatter_info()
mooc7 field.api.php hook_field_formatter_info()

Expose Field API formatter types.

Formatters handle the display of field values. Formatter hooks are typically called by the Field Attach API field_attach_prepare_view() and field_attach_view() functions.

Return value

An array describing the formatter types implemented by the module. The keys are formatter type names. To avoid name clashes, formatter type names should be prefixed with the name of the module that exposes them. The values are arrays describing the formatter type, with the following key/value pairs:

  • label: The human-readable name of the formatter type.
  • description: A short description for the formatter type.
  • field types: An array of field types the formatter supports.
  • settings: An array whose keys are the names of the settings available for the formatter type, and whose values are the default values for those settings.

See also

hook_field_formatter_info_alter()

hook_field_formatter_view()

hook_field_formatter_prepare_view()

Related topics

35 functions implement hook_field_formatter_info()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

ctools_fields_get_field_formatter_info in sites/all/modules/ulmus/ctools/includes/fields.inc
Helper function for generating all the formatter information associated with any fields. Especially useful for determining the fields that will be added to form that executes hook_field_formatter_settings_form().
date_field_formatter_info in sites/all/modules/ulmus/date/date.field.inc
Implements hook_field_formatter_info().
ds_field_formatter_info in sites/all/modules/ulmus/ds/ds.module
Implements hook_field_formatter_info().
email_field_formatter_info in sites/all/modules/ulmus/email/email.module
Implements hook_field_formatter_info().
entityreference_field_formatter_info in sites/all/modules/ulmus/entityreference/entityreference.module
Implements hook_field_formatter_info().

... See full list

2 invocations of hook_field_formatter_info()
ctools_fields_get_field_formatter_info in sites/all/modules/ulmus/ctools/includes/fields.inc
Helper function for generating all the formatter information associated with any fields. Especially useful for determining the fields that will be added to form that executes hook_field_formatter_settings_form().
_field_info_collate_types in modules/field/field.info.inc
Collates all information on field types, widget types and related structures.

File

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

Code

function hook_field_formatter_info() {
  return array(
    'text_default' => array(
      'label' => t('Default'),
      'field types' => array('text', 'text_long', 'text_with_summary'),
    ),
    'text_plain' => array(
      'label' => t('Plain text'),
      'field types' => array('text', 'text_long', 'text_with_summary'),
    ),
    
    // The text_trimmed formatter displays the trimmed version of the
    // full element of the field. It is intended to be used with text
    // and text_long fields. It also works with text_with_summary
    // fields though the text_summary_or_trimmed formatter makes more
    // sense for that field type.
    'text_trimmed' => array(
      'label' => t('Trimmed'),
      'field types' => array('text', 'text_long', 'text_with_summary'),
    ),
    
    // The 'summary or trimmed' field formatter for text_with_summary
    // fields displays returns the summary element of the field or, if
    // the summary is empty, the trimmed version of the full element
    // of the field.
    'text_summary_or_trimmed' => array(
      'label' => t('Summary or trimmed'),
      'field types' => array('text_with_summary'),
    ),
  );
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.