I want to use two block types in one Matrix field. These blocks will be output in a div. At the moment my code adds a new <div>
for each block type. How can I output two block types in the same <div>
?
<div id="da-slider" class="da-slider">
{% for block in entry.homepageSlider %}
<div class="da-slide">
{% if block.type == "sliderText" %}
<h2>{{ block.sliderHead }}</h2>
<p>{{ block.sliderText }}</p>
<a href="#" class="da-link">{{ block.sliderButton }}</a>
{% endif %}
{% if block.type == "sliderImage" %}
{% set image = block.image.first() %}
{% if image %}
<div class="da-img"><img src="{{ image.getUrl('') }}" width="{{ image.getWidth('') }}" height="{{ image.getHeight('') }}" align="{{ block.position }}" alt="image01">
</div>
{% endif %}
{% endif %}
</div>
{% endfor %}
<nav class="da-arrows">
<span class="da-arrows-prev"></span>
<span class="da-arrows-next"></span>
</nav>
</div>