Output Channel entries on another page with a matrix block I know im doing something small wrong but I cant see what at this point.
I have a channel called 'testimonialEntries' and I want to randomly output one of these entries on seperate pages. I cant output the matrix block in 'testimonialEntries' but i can the title, so i know its working just not accessing the matrix block.
{% for entries in craft.entries.section('testimonalEntries').orderBy('RAND()').limit(1).all() %}
{% block in entry.matrixBlock %}
&lt;article&gt;
    &lt;h4&gt;{{ block.heading }}&lt;/h4&gt;]
    &lt;p&gt;{{ block.bodyContent }}&lt;/p&gt;
&lt;/article&gt;
{% endfor %}{% endfor %}

In this example im getting the entry title, but how do i also get a matrix block?
Edit: AM I getting close?
{% set testimonialEntry = craft.entries.section('testimonalEntries').orderBy('RAND()').limit(1).with(['testimonial']).one() %}
{% set testimonialEntryMatrixBlocks = testimonialEntry.testimonial %}
    {% if testimonialEntryMatrixBlocks %}
    &lt;article&gt;
        &lt;p&gt;{{ testimonialEntryMatrixBlocks.body }}&lt;/p&gt;
        &lt;p&gt;{{ testimonialEntryMatrixBlocks.quote }}&lt;/p&gt;
        &lt;p&gt;{{ testimonialEntryMatrixBlocks.role }}&lt;/p&gt;
    &lt;/article&gt;
    {% endif %}

Ok final edit incase anyone else runs across this: It Works!
    {% set testimonialEntry = craft.entries.section('testimonalEntries').orderBy('RAND()').limit(1).with(['testimonial']).one() %}
{% set testimonialEntryMatrixBlocks = testimonialEntry.testimonial %}
    {% if testimonialEntryMatrixBlocks %}
        {% for testimonial in testimonialEntryMatrixBlocks %}
        &lt;article&gt;
            &lt;p&gt;{{ testimonial.body }}&lt;/p&gt;
            &lt;p&gt;{{ testimonial.quote }}&lt;/p&gt;
            &lt;p&gt;{{ testimonial.role }}&lt;/p&gt;
        &lt;/article&gt;
        {% endfor %}
    {% endif %}
No need for a loop if you're just fetching a single entry:
{% set testimonialEntry = craft.entries.section('testimonalEntries').orderBy('RAND()').limit(1).one() %}
{% set testimonialEntryMatrixBlocks = testimonialEntry.matrixField.all() %}

Ideally for better performance you'd also use eager loading to load the matrix blocks at the same time as fetching the entry:
{% set testimonialEntry = craft.entries.section('testimonalEntries').orderBy('RAND()').limit(1).with(['matrixField']).one() %}
{% set testimonialEntryMatrixBlocks = testimonialEntry.matrixField %}