Answers.Body: <p>It does not appear to be in the matrix block model. <a href="http://buildwithcraft.com/docs/templating/matrixblockmodel" rel="nofollow">http://buildwithcraft.com/docs/templating/matrixblockmodel</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-12T01:11:42.370Z
Answers.LastActivityDate: 2014-06-12T01:11:42.370Z
Answers.UserDisplayName: Steve Adams
Answers.Body: <p><code>block.type</code> is actually an alias for a <code>getType()</code> function, which returns a new <em>MatrixBlockTypeModel</em> object. Those will output their handle by default, which is why it's possible to compare <code>block.type</code>  against block type handles. But MatrixBlockTypeModel also has a <code>handle</code> property, so this is totally possible:</p>
  
  <pre><code>{{ block.type.handle }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-28T12:05:40.203Z
Answers.Text: Unfortunately, this means that using:
  
  `{% if block.type in ['video', 'image', 'gallery'] %}`
  
  …does not seem to work, [as per this example](https://craftcms.stackexchange.com/a/2910/4208).
  
  Is there another way? Using `in` is very tidy!
Answers.UserDisplayName: ianp
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-29T16:18:13.327Z
Answers.Text: @ianp You need `.name` after `block.type`
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-30T17:00:41.027Z
Answers.Text: Thanks. I have tried that and no joy.
  
  Just to be clear, `( block.type == 'video' or block.type == 'image' or block.type == 'gallery' )` does still work, however.
Answers.UserDisplayName: ianp
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-30T17:16:17.113Z
Answers.Text: Sorry I should have said `.handle`
Answers.UserDisplayName: Brandon Kelly
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-06-12T01:21:09.833Z
Answers.LastActivityDate: 2017-05-12T11:40:23.750Z
Answers.LastEditDate: 2017-05-12T11:40:23.750Z
Answers.UserDisplayName: Brandon Kelly
Body: <p>I'd like to output the Names of Matrix Blocks. I know you can <a href="http://buildwithcraft.com/docs/matrix-fields#filtering-by-block-type">filter by block types</a> e.g.</p>
  
  <pre><code>{% for block in entry.myMatrixField.type('text, heading') %}
  {% if block.type == "heading" %}
      &lt;h3&gt;{{ block.heading }}&lt;/h3&gt;
  {% else %}
      {{ block.text | markdown }}
  {% endif %}
  {% endfor %}
  </code></pre>
  
  <p>I know I could use <code>{{ block.type }}</code> and get the block type's handle but, I want to included the actual <em>Name</em> of the block type itself too.</p>
  
  <p>For example, something like this:</p>
  
  <pre><code>{{ block.type.name }}
  </code></pre>
  
  <p>Is this currently possible?</p>
  
Tags: <matrix><custom-field><blocks><filter><block-types>
Title: Is it possible to output the name of a Matrix Block?
ThreadText: # Is it possible to output the name of a Matrix Block?
  
  (Asked by: username_0 on 2014-06-12)
  
  I'd like to output the Names of Matrix Blocks. I know you can [filter by block types](http://buildwithcraft.com/docs/matrix-fields#filtering-by-block-type) e.g.
  
  ```
  {% for block in entry.myMatrixField.type('text, heading') %}
  {% if block.type == "heading" %}
      <h3>{{ block.heading }}</h3>
  {% else %}
      {{ block.text | markdown }}
  {% endif %}
  {% endfor %}
  
  ```
  
  I know I could use `{{ block.type }}` and get the block type's handle but, I want to included the actual *Name* of the block type itself too.
  
  For example, something like this:
  
  ```
  {{ block.type.name }}
  
  ```
  
  Is this currently possible?
  
  **Tags:** matrix, custom-field, blocks, filter, block-types
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2014-06-12. Score: 13 | Accepted answer
  
  `block.type` is actually an alias for a `getType()` function, which returns a new *MatrixBlockTypeModel* object. Those will output their handle by default, which is why it's possible to compare `block.type` against block type handles. But MatrixBlockTypeModel also has a `handle` property, so this is totally possible:
  
  ```
  {{ block.type.handle }}
  
  ```
  
  > **Comments:**
  > **username_3**: Unfortunately, this means that using:  `{% if block.type in ['video', 'image', 'gallery'] %}`  …does not seem to work, [as per this example](https://craftcms.stackexchange.com/a/2910/4208).  Is there another way? Using `in` is very tidy!  
  > **username_2**: @username_3 You need `.name` after `block.type`  
  > **username_3**: Thanks. I have tried that and no joy.  Just to be clear, `( block.type == 'video' or block.type == 'image' or block.type == 'gallery' )` does still work, however.  
  > **username_2**: Sorry I should have said `.handle`  
  
  ---
  
  ### Answer by username_1 on 2014-06-12. Score: 2
  
  It does not appear to be in the matrix block model. <http://buildwithcraft.com/docs/templating/matrixblockmodel>
  
  
  ---
  
  