When looping through a matrix, is there aquick way to check whether or not the block has a particular field (not if the field is empty, but if the field exists at all).
I have a matrix with ~20 block types, 12 or so have a field called blockTitle. For in-page nav, I'd like to loop through all the blocks and just output blockTitle for those that do have it. I could do this with a conditional for block.type, but am wondering if there's a simpler check (in case we add more block types in the future, don't want to have to update the conditional every time).
Using {% if block.blockTitle %} will kick back "Craft\MatrixBlockModel and its behaviors do not have a method or closure named "blockTitle"." for block types without that field, so that's a no go.
Tks.