8.3.x field_ui.api.php hook_field_formatter_settings_summary_alter(&$summary, $context)
8.0.x field_ui.api.php hook_field_formatter_settings_summary_alter(&$summary, $context)
8.1.x field_ui.api.php hook_field_formatter_settings_summary_alter(&$summary, $context)
8.2.x field_ui.api.php hook_field_formatter_settings_summary_alter(&$summary, $context)
8.4.x field_ui.api.php hook_field_formatter_settings_summary_alter(&$summary, $context)

Alters the field formatter settings summary.

Parameters

array $summary: An array of summary messages.

$context: An associative array with the following elements:

  • formatter: The formatter object.
  • field_definition: The field definition.
  • 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_third_party_test_field_formatter_settings_summary_alter in core/modules/field/tests/modules/field_third_party_test/field_third_party_test.module
Implements hook_field_formatter_settings_summary_alter().

File

core/modules/field_ui/field_ui.api.php, line 92
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_formatter has
  // mysetting set to TRUE for the current view mode.
  if ($context['formatter']->getPluginId() == 'foo_formatter') {
    if ($context['formatter']->getThirdPartySetting('my_module', 'my_setting')) {
      $summary[] = t('My setting enabled.');
    }
  }
}