Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / field_widget_info.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_info.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/field_widget_info.twig
new file mode 100644 (file)
index 0000000..a72061c
--- /dev/null
@@ -0,0 +1,36 @@
+/**
+ * Implements hook_field_widget_info().
+ */
+function {{ machine_name }}_field_widget_info() {
+  return array(
+    'text_textfield' => array(
+      'label' => t('Text field'),
+      'field types' => array('text'),
+      'settings' => array('size' => 60),
+      'behaviors' => array(
+        'multiple values' => FIELD_BEHAVIOR_DEFAULT,
+        'default value' => FIELD_BEHAVIOR_DEFAULT,
+      ),
+    ),
+    'text_textarea' => array(
+      'label' => t('Text area (multiple rows)'),
+      'field types' => array('text_long'),
+      'settings' => array('rows' => 5),
+      'behaviors' => array(
+        'multiple values' => FIELD_BEHAVIOR_DEFAULT,
+        'default value' => FIELD_BEHAVIOR_DEFAULT,
+      ),
+    ),
+    'text_textarea_with_summary' => array(
+      'label' => t('Text area with a summary'),
+      'field types' => array('text_with_summary'),
+      'settings' => array('rows' => 20, 'summary_rows' => 5),
+      'behaviors' => array(
+        'multiple values' => FIELD_BEHAVIOR_DEFAULT,
+        'default value' => FIELD_BEHAVIOR_DEFAULT,
+      ),
+      // As an advanced widget, force it to sink to the bottom of the choices.
+      'weight' => 2,
+    ),
+  );
+}