Random quotes in matrix block type I have a Matrix block with 2 types: quotes and text. The first block contains a quote and a text. The second and following ones only contain quotes.

I want the type text to be limited to 1 and the type quotes limited to one at a time displayed randomly.
Can't figure out how?

{% for block in entry.intro %}

    {% if block.type == "quote" %}
        &lt;div class="col-md-4"&gt;
            &lt;blockquote&gt;
                &lt;p&gt;{{ block.quote|raw }}&lt;/p&gt;
                &lt;footer&gt;{{ block.caption }} &lt;/footer&gt;
            &lt;/blockquote&gt;
        &lt;/div&gt;
    {% elseif block.type =="text" %}
        &lt;div class="col-md-4 col-sm-6 mb-sm-50 mb-xs-30"&gt;{{ block.column1 }}&lt;/div&gt;
        &lt;div class="col-md-4 col-sm-6 mb-sm-50 mb-xs-30"&gt;{{ block.column2 }}&lt;/div&gt;
    {% endif %}

{% endfor %}
You could query for your two blocks individually.

{% set quoteBlock = entry.intro.type('quote').first() %}
{% set textBlock = entry.intro.type('text').order('RAND()').first() %}

&lt;blockquote&gt;
    &lt;p&gt;{{ quoteBlock.quote|raw }}&lt;/p&gt;
    &lt;footer&gt;{{ quoteBlock.caption }} &lt;/footer&gt;
&lt;/blockquote&gt;

&lt;div&gt;{{ textBlock.column1 }}&lt;/div&gt;
&lt;div&gt;{{ textBlock.column2 }}&lt;/div&gt;