Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d8 / hook / field_formatter_settings_summary_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_settings_summary_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d8/hook/field_formatter_settings_summary_alter.twig
new file mode 100644 (file)
index 0000000..ee5a531
--- /dev/null
@@ -0,0 +1,12 @@
+/**
+ * Implements hook_field_formatter_settings_summary_alter().
+ */
+function {{ machine_name }}_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.');
+    }
+  }
+}