Block title missing

Created on 8 January 2024, about 1 year ago
Updated 12 January 2024, about 1 year ago

When setting a block to display it's title, none is shown.

That may be related to recent changes in commit 0d1926f1 in which radix/components/block/block.twig now checks for the block_label variable instead of label to display the title:

  {{ title_prefix }}
    {% block label %}
      {% if block_label %} {# <---- this has changed #}
        {% include 'radix:heading' with {
          html_tag: 'h2',
          content: label,
          attributes: title_attributes,
          heading_utility_classes: ['block__title']
        }
        %}
      {% endif %}
    {% endblock %}
  {{ title_suffix }}

Is that block_label variable set?
The current fix I'm using without modifing Radix block component code is to alter my subtheme/templates/block/block.html.twig to set the block_label variable content:

{% include 'radix:block' with {
  html_tag: 'div',
  block_label: label,
} %}

and voilà, the block title is back.

Have I miss a step during subtheme setup? because it seems so obvious to me the block title display is a useful feature ;-)

🐛 Bug report
Status

Active

Version

6.0

Component

Code

Created by

🇫🇷France PhilY 🇪🇺🇫🇷 Paris, France

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024