Skip to content

Commit

Permalink
Adjust condition check
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish committed Dec 5, 2023
1 parent 8e07d8e commit d408535
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
12 changes: 8 additions & 4 deletions themes/stanford_basic/stanford_basic.theme
Original file line number Diff line number Diff line change
Expand Up @@ -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().
Expand Down Expand Up @@ -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';
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
{% if not configuration.label_display %}
{% set title_attributes = title_attributes.addClass('visually-hidden') %}
{% endif %}

{{ title_prefix }}
<h2{{ title_attributes.setAttribute('id', heading_id) }}>{{ configuration.label }}</h2>
{{ title_suffix }}
Expand Down

0 comments on commit d408535

Please sign in to comment.