Alters the field formatter settings summary.
$summary: The summary.
$context: An associative array with the following elements:
\Drupal\field_ui\DisplayOverView.
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
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.');
}
}
}