Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_extra_fields.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_extra_fields.twig
new file mode 100644 (file)
index 0000000..d8376bc
--- /dev/null
@@ -0,0 +1,33 @@
+/**
+ * Implements hook_field_extra_fields().
+ */
+function {{ machine_name }}_field_extra_fields() {
+  $extra['node']['poll'] = array(
+    'form' => array(
+      'choice_wrapper' => array(
+        'label' => t('Poll choices'),
+        'description' => t('Poll choices'),
+        'weight' => -4,
+      ),
+      'settings' => array(
+        'label' => t('Poll settings'),
+        'description' => t('Poll module settings'),
+        'weight' => -3,
+      ),
+    ),
+    'display' => array(
+      'poll_view_voting' => array(
+        'label' => t('Poll vote'),
+        'description' => t('Poll vote'),
+        'weight' => 0,
+      ),
+      'poll_view_results' => array(
+        'label' => t('Poll results'),
+        'description' => t('Poll results'),
+        'weight' => 0,
+      ),
+    )
+  );
+
+  return $extra;
+}