function hook_field_formatter_settings_summary_alter

Alters the field formatter settings summary.

Parameters

$summary: The summary.

$context: An associative array with the following elements:

  • formatter: The formatter object.
  • field: The field structure being configured.
  • instance: The instance structure being configured.
  • view_mode: The view mode being configured.

See also

\Drupal\field_ui\DisplayOverView.

Related topics

1 function implements hook_field_formatter_settings_summary_alter()

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

field_test_field_formatter_settings_summary_alter in drupal/core/modules/field/tests/modules/field_test/field_test.module
Implements hook_field_formatter_settings_summary_alter().

File

drupal/core/modules/field_ui/field_ui.api.php, line 137
Hooks provided by the Field UI module.

Code

function hook_field_formatter_settings_summary_alter(&$summary, $context) {

  // Append a message to the summary when an instance of foo_field has
  // mysetting set to TRUE for the current view mode.
  if ($context['field']['type'] == 'foo_field') {
    if ($context['formatter']
      ->getSetting('mysetting')) {
      $summary[] = t('My setting enabled.');
    }
  }
}