I have a Matrix field setup. I want to be able to pull in the first Matrix block used to print a snippet, but only out of the blocks 'text' or 'textImage'. So the first one used, out of those two only.
This is what I have but it's pulling in the textContent block regardless, even if the text block is first.
{% set textBlock = entry.body.type('text').first() %}
{% set textBlock2 = entry.body.type('textImage').first() %}
{% if textBlock %}
<p>{{ textBlock.textContent|hacksaw(chars='100', append='...') }}</p>
{% else %}
{% if textBlock2 %}
<p>{{ textBlock2.text|hacksaw(chars='100', append='...') }}</p>
{% endif %}
{% endif %}