From 8cfa76e9f4e0aae4d1243a1213d7f1429fb9a28c Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Thu, 21 May 2020 13:18:40 +0100 Subject: [PATCH] Add markup class to the featured posts block --- web/modules/custom/custom/custom.module | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/web/modules/custom/custom/custom.module b/web/modules/custom/custom/custom.module index 1d94853..709199a 100644 --- a/web/modules/custom/custom/custom.module +++ b/web/modules/custom/custom/custom.module @@ -17,3 +17,13 @@ function custom_entity_type_build(array &$entityTypes): void { $entityTypes['node']->setClass(Node::class); } } + +/** + * Implements hook_preprocess_HOOK(). + */ +function custom_preprocess_block(array &$variables): void { + // Add the 'markup' class to blocks. + if (in_array($variables['plugin_id'], ['views_block:featured_blog_posts-block_1'])) { + $variables['attributes']['class'][] = 'markup'; + } +}