X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fmodules%2Fcontrib%2Fmetatag%2Fmetatag.api.php;h=7f3c82c63b8218b8163b4f0786014ab0d7154796;hb=eba34333e3c89f208d2f72fa91351ad019a71583;hp=ee487e5a66cdae5eb43dd739a1fa528a61f879e5;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/modules/contrib/metatag/metatag.api.php b/web/modules/contrib/metatag/metatag.api.php index ee487e5a6..7f3c82c63 100644 --- a/web/modules/contrib/metatag/metatag.api.php +++ b/web/modules/contrib/metatag/metatag.api.php @@ -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; + } +}