I'm using Craft Pro 3.0.0-beta.19 and I try to query matrix blocks with craft.matrixBlocks(). Background: I have event series (=structure) with a matrix block containing 1:n dates for each series. My block type in the "dates" matrix block is "eventDate" and looks like this: Block Definition

this works:

{% set entries = craft.matrixBlocks() %}

Since this is the first matrix block I have I get all the entries I have (2):

{{ entries | length }} will output: 2 {{ entries.one().type }} will output: eventDate


Now I want to limit the blocks to eventDate only

{% set entries = craft.matrixBlocks.type('eventDate') %}

On the first glance this seems to work, I get the same results.

But when I change this to

{% set entries = craft.matrixBlocks.type('WhateverGoesHere') %}

I still get the same results. Am i not understanding this or is it a bug?

Thanks, Matthias


1 Answer 1


This was a bug in a beta version of Craft 3 (fixed here: https://github.com/craftcms/cms/commit/9b6dad7385c5a82d1c83d230fe6ce0cfe940675b)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.