Skip to content

Commit 8fcd796

Browse files
smulvihillsylus
authored andcommitted
Issue #3277101 by smulvih2: Block headings
1 parent faf8254 commit 8fcd796

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

templates/block/block.html.twig

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,18 @@
5353
'clearfix',
5454
]
5555
%}
56-
<section{{ attributes.addClass(classes) }}>
56+
57+
{% set element = label_display or display_title_invisible ? 'section' : 'div' %}
58+
<{{ element }}{{ attributes.addClass(classes) }}>
5759
{{ title_prefix }}
58-
{% if label %}
60+
{% if display_title_invisible %}
61+
<h2{{ title_attributes.addClass('wb-inv') }}>{{ label }}</h2>
62+
{% elseif label %}
5963
<h2{{ title_attributes.addClass('block-title') }}>{{ label }}</h2>
6064
{% endif %}
6165
{{ title_suffix }}
6266

6367
{% block content %}
6468
{{ content }}
6569
{% endblock %}
66-
</section>
70+
</{{ element }}>

wxt_bootstrap.theme

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ function wxt_bootstrap_preprocess_block(&$variables) {
122122
$variables['label_opposite'] = 'Government of Canada';
123123
}
124124
}
125+
126+
$moduleHandler = \Drupal::service('module_handler');
127+
if (!$moduleHandler->moduleExists('wxt_ext_blocks')) {
128+
$variables['label_display'] = TRUE;
129+
}
125130
}
126131

127132
/**

0 commit comments

Comments
 (0)