You are here

function hook_field_formatter_info in Content Construction Kit (CCK) 5

Declare information about a formatter.

Return value

An array keyed by formatter name. Each element of the array is an associative array with these keys and values:

  • "label": The human-readable label for the formatter.
  • "field types": An array of field type names that can be displayed using this formatter.
4 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.

nodereference_field_formatter_info in ./nodereference.module
Implementation of hook_field_formatter_info().
number_field_formatter_info in ./number.module
Implementation of hook_field_formatter_info().
text_field_formatter_info in ./text.module
Implementation of hook_field_formatter_info().
userreference_field_formatter_info in ./userreference.module
Implementation of hook_field_formatter_info().
1 invocation of hook_field_formatter_info()
_content_type_info in ./content.module
Collate all information on content types, fields, and related structures.

File

./field.php, line 238
These hooks are defined by field modules, modules that define a new kind of field for insertion in a content type.

Code

function hook_field_formatter_info() {
  return array(
    'default' => array(
      'label' => t('Default'),
      'field types' => array(
        'text',
      ),
    ),
    'plain' => array(
      'label' => t('Plain text'),
      'field types' => array(
        'text',
      ),
    ),
    'trimmed' => array(
      'label' => t('Trimmed'),
      'field types' => array(
        'text',
      ),
    ),
  );
}