Return Matrix Field block number Just wondering if there's a way to return the matrix block number during the loop?

For example:

{% for block in entry.myMatrixField %}
  {% if block.type == "quote" %}
    &lt;blockquote class="quote{{GET_BLOCK_NUMBER}}"&gt;
      &lt;p&gt;{{ block.quote }}&lt;/p&gt;
    &lt;/blockquote&gt;
  {% endif %}
{% endfor %}


Might return something like this:

&lt;blockquote class="quote1"&gt;
  &lt;p&gt;Curabitur aliquet quam id dui posuere blandit.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote class="quote2"&gt;
  &lt;p&gt;Curabitur aliquet quam id dui posuere blandit.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;blockquote class="quote3"&gt;
  &lt;p&gt;Curabitur aliquet quam id dui posuere blandit.&lt;/p&gt;
&lt;/blockquote&gt;


Thanks, Mark
Yes that's possible, all Twig loops have a loop variable:


  loop.index - The current iteration of the loop. (1 indexed)
  loop.index0 - The current iteration of the loop. (0 indexed)


Example:

{% for block in entry.myMatrixField %}
  {% if block.type == "quote" %}
    &lt;blockquote class="quote{{ loop.index }}"&gt;
      &lt;p&gt;{{ block.quote }}&lt;/p&gt;
    &lt;/blockquote&gt;
  {% endif %}
{% endfor %}