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
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:
- 3413229-block-title-missing
changes, plain diff MR !75
Comments
Comment #4
tirupati_singh commented@PhilY, the issue occurring because no value is being passed in
/components/block/block.twigand in the template the block title is being render through if condition by checking theblock_labelvariable and in/src/kits/radix_starterkit/templates/block/block.html.twigno such variable is declared.Comment #5
doxigo commentedThanks 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.