This is a great new feature of Craft 2.3:
It is now possible to set custom field parameters on Matrix block queries.
I was wondering what would happen, if two or more Matrix Block Types had a field with the same handle (e.g. myLightswitchField
), and if it was possible to query for blocks across Block Types using this field as a parameter.
My example code doesn't return any blocks:
{% set blocks = entry.myMatrixField.myLightswitchField('1') %}
Yeah! There's {{ blocks|length }} Matrix blocks enabled.
This is just an example! I know that you can disable blocks from the block's context menu.