You are here

function entityreference_multiple_field_formatter_info in Entity reference multiple display 7

Implements hook_field_formatter_info().

File

./entityreference_multiple.module, line 11
Extend entity reference formatter with an option to separate elements display with specific view_modes.

Code

function entityreference_multiple_field_formatter_info() {
  return array(
    'entityreference_entity_multiple_view' => array(
      'label' => t('Rendered entity with different view modes'),
      'description' => t('Display the referenced entities rendered by entity_view() with different view modes.'),
      'field types' => array(
        'entityreference',
      ),
      'settings' => array(
        'view_mode_number' => 2,
        'view_mode_multiple' => array(
          'view_mode_1' => 'full',
          'view_mode_1_number' => '1',
          'view_mode_1_links' => TRUE,
          'view_mode_2' => 'teaser',
          'view_mode_2_number' => '#',
          'view_mode_2_links' => TRUE,
        ),
      ),
    ),
  );
}