Switch Matrix block on handle rather than type I've got a matrix with a Block type called textBlocks which Craft seems to be having trouble seeing.

The error is:

Craft\MatrixBlockModel and its behaviors do not have a method or closure named "textBlocks".


My template code is:

{% for block in entry.clientsContent %}

 {% switch block.type %}

{% case "text" %}


 &lt;div class="small-{{ block.columns }}"&gt;
  &lt;h3&gt;{{ block.blockTitle }}&lt;/h3&gt;
  &lt;p&gt;{{ block.blockContent }}&lt;/p&gt;
 &lt;/div&gt;


{% case "images" %}
 &lt;ul class="small-block-grid-{{ block.blockGrid }}"&gt;
  {% for asset in block.images %}
   &lt;li&gt;
    &lt;img src="{{ asset.getUrl() }}" alt=""/&gt;
   &lt;/li&gt;
  {% endfor %}
 &lt;/ul&gt;

 {% case "textBlocks" %}
 &lt;ul class="small-block-grid-{{ textBlocks.blockGridNumber }}"&gt;
  {% for row in block.textBlocks %}
   &lt;li&gt;&lt;h5&gt;{{ row.title }}&lt;/h5&gt; &lt;p&gt;{{ row.content }}&lt;/p&gt;&lt;/li&gt;
  {% endfor %}
 &lt;/ul&gt;
{% endswitch %}

{% endfor %}


Am i getting this right here? When you do switch block.type is block.type the Block Type name?

See pic for my Matrix setup:
I think you already spotted it. 

Change:

&lt;ul class="small-block-grid-{{ textBlocks.blockGridNumber }}"&gt;


To:

&lt;ul class="small-block-grid-{{ block.blockGridNumber }}"&gt;