Loop through matrix field find first block of a type I'm trying to loop through a matrix field that has a few different types of fields in it and different orders. I want to first the first field of a certain type and output only that. Here is what I have so far. 

{% for block in entry.blogPostMainSection.all() %}

{% if block.type == "blogText" %}

    {% set articleText =  block.blogArticleText %}

        {% if articleText | length &gt; 100 %}

            {% set articleTextTrim = block.blogArticleText|slice(0, 100) ~ '...' %}

            {{articleTextTrim | striptags}}

        {% else %}

            {{articleText | striptags}}

        {% endif %}

{% endif %}

{% endfor %}
{% set myFirstMatrixBlockWithType = entry.blogPostMainSection.type('blogText').one() %}

{{ myFirstMatrixBlockWithType.articleText }} 


Keep in mind entry.blogPostMainSection is not an array of blocks but a Query