Filter Entries by Matrix Block I have a matrix field with two block-types (&quot;sound&quot; and &quot;video&quot;)
I want to get all entries that have a matrix field with a certain block-type.
At the moment I have:
{% set entries = craft.entries()
        .section(['events', 'sessions'])
        .orderBy('datum desc')
        .matrixField(':notempty:')
        .limit(30)
        .all() %}

how can i get all entries that have a &quot;video&quot;-block in the matrix-field?
I want to paginate the results.
Thanks!
You'll have to query all matrixes in that field with that type first. With these results, you should then be able to query the entries that are relatedTo these results.
You'll end up with
{% set matrixes = craft.matrixBlocks()
    .field('matrixField')
    .type('video')
    .all() %}

{% set entries = craft.entries()
    .section(['events', 'sessions'])
    .orderBy('datum desc')
    .matrixField(':notempty:')
    .relatedTo(matrixes)
    .limit(30)
    .all() %}

Documentation about relations can be found here