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 @@ #} {{ title_prefix }} - {% if label %} - {{ label }} + {% if title %} + {{ title }} {% endif %} {{ title_suffix }} {% block content %} diff --git a/core/themes/bartik/templates/block.html.twig b/core/themes/bartik/templates/block.html.twig index 31a95c0..674d0e6 100644 --- a/core/themes/bartik/templates/block.html.twig +++ b/core/themes/bartik/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. @@ -44,8 +45,8 @@ %} {{ title_prefix }} - {% if label %} - {{ label }} + {% if title %} + {{ title }} {% endif %} {{ title_suffix }} {% block content %} diff --git a/core/themes/classy/templates/block/block--search-form-block.html.twig b/core/themes/classy/templates/block/block--search-form-block.html.twig index 0b162dd..603bedd 100644 --- a/core/themes/classy/templates/block/block--search-form-block.html.twig +++ b/core/themes/classy/templates/block/block--search-form-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, including: * - label: The configured label for the block. * - label_display: The display settings for the label. @@ -42,8 +43,8 @@ %} {{ title_prefix }} - {% if label %} - {{ label }} + {% if title %} + {{ title }} {% endif %} {{ title_suffix }} {% block content %} diff --git a/core/themes/classy/templates/block/block--system-menu-block.html.twig b/core/themes/classy/templates/block/block--system-menu-block.html.twig index 6d5371c..fc9b74f 100644 --- a/core/themes/classy/templates/block/block--system-menu-block.html.twig +++ b/core/themes/classy/templates/block/block--system-menu-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. diff --git a/core/themes/classy/templates/block/block.html.twig b/core/themes/classy/templates/block/block.html.twig index a85c82c..3f7527a 100644 --- a/core/themes/classy/templates/block/block.html.twig +++ b/core/themes/classy/templates/block/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. @@ -40,8 +41,8 @@ %} {{ title_prefix }} - {% if label %} - {{ label }} + {% if title %} + {{ title }} {% endif %} {{ title_suffix }} {% block content %}