Version 1
[yaffs-website] / web / modules / contrib / metatag / src / Plugin / metatag / Tag / Description.php
diff --git a/web/modules/contrib/metatag/src/Plugin/metatag/Tag/Description.php b/web/modules/contrib/metatag/src/Plugin/metatag/Tag/Description.php
new file mode 100644 (file)
index 0000000..888a2ff
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+
+namespace Drupal\metatag\Plugin\metatag\Tag;
+
+/**
+ * The basic "Description" meta tag.
+ *
+ * @MetatagTag(
+ *   id = "description",
+ *   label = @Translation("Description"),
+ *   description = @Translation("A brief and concise summary of the page's content, preferably 150 characters or less. The description meta tag may be used by search engines to display a snippet about the page in search results."),
+ *   name = "description",
+ *   group = "basic",
+ *   weight = 2,
+ *   type = "label",
+ *   secure = FALSE,
+ *   multiple = FALSE
+ * )
+ */
+class Description extends MetaNameBase {
+
+  /**
+   * Generate a form element for this meta tag.
+   */
+  public function form(array $element = []) {
+    $form = [
+      '#type' => 'textarea',
+      '#title' => $this->label(),
+      '#default_value' => $this->value(),
+      '#row' => 2,
+      '#required' => isset($element['#required']) ? $element['#required'] : FALSE,
+      '#description' => $this->description(),
+      '#element_validate' => [[get_class($this), 'validateTag']],
+    ];
+    return $form;
+  }
+
+}