You are here

function hook_field_group_formatter_info in Field Group 7

Same name and namespace in other branches
  1. 7.2 field_group.api.php \hook_field_group_formatter_info()

Implements hook_field_group_formatter_info().

Define the information on formatters. The formatters are separated by view mode type. We have "form" for all form elements and "display" will be the real view modes (full, teaser, sticky, ...)

structure:


array(
  'form' => array(
    'fieldset' => array(
      // required, String with the name of the formatter type.
      'label' => t('Fieldset'),
      // optional, String description of the formatter type.
      'description' => t('This is field group that ...'),
      // required, Array of available formatter options.
      'format_types' => array('open', 'collapsible', 'collapsed'),
      // required, String with default value of the style.
        'default_formatter' => 'collapsible',
      // optional, Array with key => default_value pairs.
      'instance_settings' => array('key' => 'value'),
    ),
  ),
  'display' => array(
    'fieldset' => array(
      // required, String with the name of the formatter type.
      'label' => t('Fieldset'),
      // optional, String description of the formatter type.
      'description' => t('This is field group that ...'),
      // required, Array of available formatter options.
      'format_types' => array('open', 'collapsible', 'collapsed'),
      // required, String with default value of the style.
        'default_formatter' => 'collapsible',
      // optional, Array with key => default_value pairs.
      'instance_settings' => array('key' => 'value'),
    ),
  ),
),

Return value

$formatters A collection of available formatting html controls for form and display overview type.

See also

field_group_field_group_formatter_info()

1 function implements hook_field_group_formatter_info()

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

field_group_field_group_formatter_info in ./field_group.module
Implements hook_field_group_formatter_info().
1 invocation of hook_field_group_formatter_info()
field_group_formatter_info in ./field_group.module
Function to retrieve all format possibilities for the fieldgroups.

File

./field_group.api.php, line 85
Hooks provided by the Field Group module.

Code

function hook_field_group_formatter_info() {
  return array(
    'form' => array(
      'fieldset' => array(
        'label' => t('Fieldset'),
        'description' => t('This fieldgroup renders the inner content in a fieldset with the title as legend.'),
        'format_types' => array(
          'open',
          'collapsible',
          'collapsed',
        ),
        'instance_settings' => array(
          'classes' => '',
        ),
        'default_formatter' => 'collapsible',
      ),
    ),
    'display' => array(
      'div' => array(
        'label' => t('Div'),
        'description' => t('This fieldgroup renders the inner content in a simple div with the title as legend.'),
        'format_types' => array(
          'open',
          'collapsible',
          'collapsed',
        ),
        'instance_settings' => array(
          'effect' => 'none',
          'speed' => 'fast',
          'classes' => '',
        ),
        'default_formatter' => 'collapsible',
      ),
    ),
  );
}