From 7541074ad952dfefbb99ae09cc896134160c8e1d Mon Sep 17 00:00:00 2001 From: Eric Bremner <ebremner@uwaterloo.ca> Date: Thu, 25 Nov 2021 20:38:36 +0000 Subject: [PATCH] ISTWCMS-5234: updating theme to use new hero at top of page --- templates/blocks/block--page-title-block.html.twig | 2 +- uw_fdsu_theme_resp.theme | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/templates/blocks/block--page-title-block.html.twig b/templates/blocks/block--page-title-block.html.twig index 53da1c15..1a12fe24 100644 --- a/templates/blocks/block--page-title-block.html.twig +++ b/templates/blocks/block--page-title-block.html.twig @@ -1,4 +1,4 @@ -{% if featured_image == 'no' %} +{% if hero == 'no' %} {% set classes = [ 'block', diff --git a/uw_fdsu_theme_resp.theme b/uw_fdsu_theme_resp.theme index c846475b..ffeacc51 100644 --- a/uw_fdsu_theme_resp.theme +++ b/uw_fdsu_theme_resp.theme @@ -394,9 +394,9 @@ function uw_fdsu_theme_resp_preprocess_block(&$variables) { // If we do then, set variable to not show page title. if ($variables['plugin_id'] == 'page_title_block') { - // Set the featured image variable to no, we will only - // change if there is a featured image. - $variables['featured_image'] = 'no'; + // Set the hero variable to no, we will only + // change if there is a hero. + $variables['hero'] = 'no'; // Load the node. $node = \Drupal::routeMatch()->getParameter('node'); @@ -409,13 +409,13 @@ function uw_fdsu_theme_resp_preprocess_block(&$variables) { $node = Node::load($node); } - // If there is a node, check that it has a featured image. + // If there is a node, check that it has a hero. if ($node) { // The UW service object. $uwService = \Drupal::service('uw_cfg_common.uw_service'); - $variables['featured_image'] = $uwService->uwCheckNodeForFeaturedImage($node); + $variables['hero'] = $uwService->uwCheckNodeForHero($node); } } @@ -508,7 +508,7 @@ function uw_fdsu_theme_resp_preprocess_container(&$variables) { // Set variables for featured image. $variables['node_type'] = str_replace('_', '-', $node->getType()); - $variables['featured_image'] = $uwService->uwCheckNodeForFeaturedImage($node); + $variables['hero'] = $uwService->uwCheckNodeForHero($node); // If there is a node object, get the header and footer data. if ($node) { -- GitLab