New answers tagged

0

You could go via entries() and do something like this: {% set blockCount = craft.entries() .section('yourSectionHandle') .with([ ['matrixFieldHandle', {type: 'blockHandle'}] ]) .all() | map(b => b.blocks | length) | reduce((carry, v) => carry + v) %} In short, map (docs) builds an array of block count/per entry and reduce (docs)...


Top 50 recent answers are included