Getting fields of Matrix? How can I get the fields of a matrix field? I want to loop through the fields. I have the fields of the section, if the field.handle is of type matrix, I want to get the fields of the matrix.
Looping through a Matrix field is pretty easy, here is an example. Also read the docs on the Matrix field here - https://craftcms.com/docs/matrix-fields

{% for block in entry.myMatrix %}
    {% set handle = block.type.handle %} {# Grab the current block handle #}

    {{ handle }} {# Echo out the handle #}

    {% if handle == 'myMatrixBlock' %}
        {{ myMatrixBlock.heading }}  {# If you have a field called heading in myMatrixBlock #}
    {% endif %}

{% endfor %}




Updated 

Take a look at these examples...

getting fields of a section (getFields())

How to loop through matrix block fields and pull out handle and content?