Answers.Body: <p>I think you already spotted it. </p>
  
  <p>Change:</p>
  
  <pre><code>&lt;ul class="small-block-grid-{{ textBlocks.blockGridNumber }}"&gt;
  </code></pre>
  
  <p>To:</p>
  
  <pre><code>&lt;ul class="small-block-grid-{{ block.blockGridNumber }}"&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-01T19:34:50.490Z
Answers.Text: Yeah i'm an idiot.
Answers.UserDisplayName: John
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-02-01T17:59:54.503Z
Answers.LastActivityDate: 2015-02-01T17:59:54.503Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>I've got a matrix with a Block type called textBlocks which Craft seems to be having trouble seeing.</p>
  
  <p>The error is:</p>
  
  <pre><code>Craft\MatrixBlockModel and its behaviors do not have a method or closure named "textBlocks".
  </code></pre>
  
  <p>My template code is:</p>
  
  <pre><code>{% 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 %}
  </code></pre>
  
  <p>Am i getting this right here? When you do switch block.type is block.type the Block Type name?</p>
  
  <p>See pic for my Matrix setup:
  <img src="https://i.sstatic.net/WFn5f.png" alt="enter image description here"></p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-02-01T17:48:22.877Z
Comments.Text: Ah no, i have just made a code error like a fool!
Comments.UserDisplayName: John
Tags: <matrix>
Title: Switch Matrix block on handle rather than type
ThreadText: # Switch Matrix block on handle rather than type
  
  (Asked by: username_0 on 2015-02-01)
  
  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>
   </div>
  
  {% case "images" %}
   <ul class="small-block-grid-{{ block.blockGrid }}">
    {% for asset in block.images %}
     <li>
      <img src="{{ asset.getUrl() }}" alt=""/>
     </li>
    {% endfor %}
   </ul>
  
   {% 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 %}
   </ul>
  {% 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](https://i.sstatic.net/WFn5f.png)
  
  **Tags:** matrix
  
  > **Comments:**
  > **username_0**: Ah no, i have just made a code error like a fool!  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-02-01. Score: 3
  
  I think you already spotted it.
  
  Change:
  
  ```
  <ul class="small-block-grid-{{ textBlocks.blockGridNumber }}">
  
  ```
  
  To:
  
  ```
  <ul class="small-block-grid-{{ block.blockGridNumber }}">
  
  ```
  
  > **Comments:**
  > **username_0**: Yeah i'm an idiot.  
  
  ---
  
  