From d40853539bcf62a0ad26d30e1fca5ecc690c49e0 Mon Sep 17 00:00:00 2001 From: Mike Decker Date: Tue, 5 Dec 2023 08:48:27 -0800 Subject: [PATCH] Adjust condition check --- themes/stanford_basic/stanford_basic.theme | 12 ++++++++---- .../block/block--system-menu-block.html.twig | 1 - 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/themes/stanford_basic/stanford_basic.theme b/themes/stanford_basic/stanford_basic.theme index a2f3a67fb..ca0d249fd 100755 --- a/themes/stanford_basic/stanford_basic.theme +++ b/themes/stanford_basic/stanford_basic.theme @@ -5,11 +5,12 @@ * Preprocess functions for Stanford Basic. */ -use Drupal\Core\Render\Element; -use Drupal\Core\Cache\CacheableMetadata; -use Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage; use Drupal\Component\Utility\Html; +use Drupal\Core\Block\BlockPluginInterface; +use Drupal\Core\Cache\CacheableMetadata; +use Drupal\Core\Render\Element; use Drupal\Core\Url; +use Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage; /** * Implements hook_library_info_alter(). @@ -227,7 +228,10 @@ function stanford_basic_preprocess_block(&$variables) { } } - if (!isset($variables['configuration']['label_display'])) { + if ( + !isset($variables['configuration']['label_display']) || + $variables['configuration']['label_display'] != BlockPluginInterface::BLOCK_LABEL_VISIBLE + ) { $variables['title_attributes']['aria-hidden'] = 'true'; } } diff --git a/themes/stanford_basic/templates/block/block--system-menu-block.html.twig b/themes/stanford_basic/templates/block/block--system-menu-block.html.twig index 06740156c..03613ed7b 100755 --- a/themes/stanford_basic/templates/block/block--system-menu-block.html.twig +++ b/themes/stanford_basic/templates/block/block--system-menu-block.html.twig @@ -45,7 +45,6 @@ {% if not configuration.label_display %} {% set title_attributes = title_attributes.addClass('visually-hidden') %} {% endif %} - {{ title_prefix }} {{ configuration.label }} {{ title_suffix }}