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 ;-)

Issue fork radix-3413229

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

PhilY created an issue. See original summary.

Tirupati_Singh made their first commit to this issue’s fork.

tirupati_singh’s picture

Status: Active » Needs review

@PhilY, the issue occurring because no value is being passed in /components/block/block.twig and in the template the block title is being render through if condition by checking the block_label variable and in /src/kits/radix_starterkit/templates/block/block.html.twig no such variable is declared.

doxigo’s picture

Status: Needs review » Fixed

Thanks for the issue and the merge request, the MR is just wrong, the problem was that when I renamed the label to block_label, I renamed the if condition :) pushed a fix though.

  • doxigo committed 13c9e7ad on 6.0.x
    Issue #3413229 by Tirupati_Singh, PhilY: Block title missing
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.