diff --git a/core/modules/block/block.module b/core/modules/block/block.module index 9d5f406..8602e2a 100644 --- a/core/modules/block/block.module +++ b/core/modules/block/block.module @@ -238,12 +238,12 @@ function template_preprocess_block(&$variables) { $variables['plugin_id'] = $variables['elements']['#plugin_id']; $variables['base_plugin_id'] = $variables['elements']['#base_plugin_id']; $variables['derivative_plugin_id'] = $variables['elements']['#derivative_plugin_id']; - $variables['label'] = !empty($variables['configuration']['label_display']) ? $variables['configuration']['label'] : ''; + $variables['title'] = !empty($variables['configuration']['label_display']) ? $variables['configuration']['label'] : ''; $variables['content'] = $variables['elements']['content']; - // A block's label is configuration: it is static. Allow dynamic labels to be + // A block's title is configuration: it is static. Allow dynamic titles to be // set in the render array. if (isset($variables['elements']['content']['#title']) && !empty($variables['configuration']['label_display'])) { - $variables['label'] = $variables['elements']['content']['#title']; + $variables['title'] = $variables['elements']['content']['#title']; } // Create a valid HTML ID and make sure it is unique. @@ -252,8 +252,8 @@ function template_preprocess_block(&$variables) { } // Proactively add aria-describedby if possible to improve accessibility. - if ($variables['label'] && isset($variables['attributes']['role'])) { - $variables['title_attributes']['id'] = Html::getUniqueId($variables['label']); + if ($variables['title'] && isset($variables['attributes']['role'])) { + $variables['title_attributes']['id'] = Html::getUniqueId($variables['title']); $variables['attributes']['aria-describedby'] = $variables['title_attributes']['id']; } diff --git a/core/modules/block/templates/block.html.twig b/core/modules/block/templates/block.html.twig index 236b3cf..ce03995 100644 --- a/core/modules/block/templates/block.html.twig +++ b/core/modules/block/templates/block.html.twig @@ -5,7 +5,8 @@ * * Available variables: * - plugin_id: The ID of the block implementation. - * - label: The configured label of the block if visible. + * - title: The configured title (equivalent to 'label' in internal block speak) + * of the block if visible. * - configuration: A list of the block's configuration values. * - label: The configured label for the block. * - label_display: The display settings for the label. @@ -36,8 +37,8 @@ #}