Yaffs site version 1.1
[yaffs-website] / web / modules / contrib / metatag / metatag.api.php
index ee487e5a66cdae5eb43dd739a1fa528a61f879e5..7f3c82c63b8218b8163b4f0786014ab0d7154796 100644 (file)
@@ -24,3 +24,18 @@ function hook_metatag_route_entity(\Drupal\Core\Routing\RouteMatchInterface $rou
     }
   }
 }
+
+/**
+ * Alter the metatags for pages that are not of content entities.
+ *
+ * @param array $metatags
+ *   The special metatags to be added to the page.
+ * @param array $context
+ *   The context, containing the entity used for token replacements.
+ */
+function hook_metatags_alter(array &$metatags, array $context) {
+  // Exclude metatags on frontpage.
+  if (\Drupal::service('path.matcher')->isFrontPage()) {
+    $metatags = NULL;
+  }
+}