Skip to content

Commit 1232f61

Browse files
authored
Hides title on cards if no icon or title
Thanks @kmurphychi40 !
2 parents d1fe782 + a298d5c commit 1232f61

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

templates/paragraph--bp-card.html.twig

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -440,15 +440,17 @@ view_mode ? 'paragraph--view-mode--' ~ view_mode|clean_class,
440440
<div{{ attributes.addClass(classes) }}>
441441
<div class="paragraph__column">
442442
<div class="card card-default panel panel-default">
443-
<div class="card-header panel-heading">
444-
{% if layout_icon_classes %}
445-
<span class="{{ layout_icon_classes|join(' ') }}"></span>
446-
{% endif %}
447-
{{ title_suffix }}
448-
<div class="card-title panel-title">
449-
{{ content.bp_card_title }}
443+
{% if layout_icon_classes or content.bp_card_title|render|trim is not empty %}
444+
<div class="card-header panel-heading">
445+
{% if layout_icon_classes %}
446+
<span class="{{ layout_icon_classes|join(' ') }}"></span>
447+
{% endif %}
448+
{{ title_suffix }}
449+
<div class="card-title panel-title">
450+
{{ content.bp_card_title }}
451+
</div>
450452
</div>
451-
</div>
453+
{% endif %}
452454
<div class="card-block panel-body">
453455
{{ content|without('bp_width', 'bp_background', 'bp_accent_color', 'bp_icon', 'bp_card_title') }}
454456
</div>

0 commit comments

Comments
 (0)