Skip to content

Commit

Permalink
Merge pull request #866 from droptica/feature/DROOP-1043-divider-is-v…
Browse files Browse the repository at this point in the history
…isible-when-there-is-no-content-under-header

DROOP-1043 Divider is not visible when there is no header and content
  • Loading branch information
js-droptica authored Jan 5, 2024
2 parents 7c21dff + 3b7e78b commit 820a040
Showing 1 changed file with 24 additions and 13 deletions.
37 changes: 24 additions & 13 deletions themes/custom/droopler_theme/src/components/d-p-form/d-p-form.twig
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,33 @@
</div>
</div>

<div {{ bem('content', [], base_class, ['container']) }}>
<div {{ bem('content-wrapper', [], base_class, ['row']) }}>
<div {{ bem('content-column', ['header'], base_class, [content_classes]) }}>
{% block header %}
{% endblock %}
<div {{ bem('content', [], base_class, ['container']) }}>
<div {{ bem('content-wrapper', [], base_class, ['row']) }}>

{% include '@droopler_theme/base/divider/divider.twig' %}
{% set has_header = block('header')|render|striptags('<img>')|trim is not empty %}
{% set has_content = block('content')|render|striptags|trim is not empty %}

{% block content %}
{% endblock %}
</div>
{% if has_header or has_content %}
<div {{ bem('content-column', ['header'], base_class, [content_classes]) }}>

{% if has_header %}
{% block header %}
{% endblock %}

{% if has_content %}
{% include '@droopler_theme/base/divider/divider.twig' %}
{% endif %}
{% endif %}

<div {{ bem('content-column', ['form'], base_class, [form_classes]) }}>
{% block form %}
{% endblock %}
{% block content %}
{% endblock %}
</div>
{% endif %}

<div {{ bem('content-column', ['form'], base_class, [form_classes]) }}>
{% block form %}
{% endblock %}
</div>
</div>
</div>
</div>
</section>

0 comments on commit 820a040

Please sign in to comment.