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" %}

 <div class="small-{{ block.columns }}">
  <h3>{{ block.blockTitle }}</h3>
  <p>{{ block.blockContent }}</p>

{% case "images" %}
 <ul class="small-block-grid-{{ block.blockGrid }}">
  {% for asset in block.images %}
    <img src="{{ asset.getUrl() }}" alt=""/>
  {% endfor %}

 {% case "textBlocks" %}
 <ul class="small-block-grid-{{ textBlocks.blockGridNumber }}">
  {% for row in block.textBlocks %}
   <li><h5>{{ row.title }}</h5> <p>{{ row.content }}</p></li>
  {% endfor %}
{% 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: enter image description here

  • Ah no, i have just made a code error like a fool!
    – John
    Feb 1, 2015 at 17:48

1 Answer 1


I think you already spotted it.


<ul class="small-block-grid-{{ textBlocks.blockGridNumber }}">


<ul class="small-block-grid-{{ block.blockGridNumber }}">
  • Yeah i'm an idiot.
    – John
    Feb 1, 2015 at 19:34

Your Answer

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

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