<p>Is there a way to pull out all entry fields for an entry by their handle so they can be looped through?</p>

<p>For example rather than doing each field manually like <code>{{ entry.title }}</code>, <code>{{ entry.description }}</code> and <code>{{ entry.date }}</code>, just do a loop.</p>

<pre><code>{% for field in entry %}
    {{ field.fieldHandle }}
{% endfor %}
</code></pre>

CC BY-SA 3.0
2015-08-18T13:04:35.787Z
Hey Lettie, have at the question linked above and let us know if it solves your problem.
carlcs
CC BY-SA 3.0
2015-08-19T09:37:35.540Z
Cheers @carlcs that's certainly helped. Quick question I want to also check if the field is a matrix field and then pull out all the block handles and content. I've tried:
    {% if field.fieldType == 'Matrix' %}
        <strong>Matrix Field: </strong>
    {% endif %}
But with no luck also tried just field.type and lower case matrix. What am I missing? Cheers.
Lettie
CC BY-SA 3.0
2015-08-19T09:47:35.170Z
Ignore that was almost there worked it out field.type == 'Matrix' thanks for you help.
Lettie
<entries><field><entries-field>
Return all entry types or entry fields for one entry object
# Return all entry types or entry fields for one entry object

(Asked by: username_0 on 2015-08-17)

Is there a way to pull out all entry fields for an entry by their handle so they can be looped through?
For example rather than doing each field manually like {{ entry.title }}, {{ entry.description }} and {{ entry.date }}, just do a loop.
{% for field in entry %}
    {{ field.fieldHandle }}
{% endfor %}

**Tags:** entries, field, entries-field
> **Comments:**
> **username_1**: Hey Lettie, have at the question linked above and let us know if it solves your problem.  
> **username_0**: Cheers @carlcs that's certainly helped. Quick question I want to also check if the field is a matrix field and then pull out all the block handles and content. I've tried:     {% if field.fieldType == 'Matrix' %}         <strong>Matrix Field: </strong>     {% endif %} But with no luck also tried just field.type and lower case matrix. What am I missing? Cheers.  
> **username_0**: Ignore that was almost there worked it out field.type == 'Matrix' thanks for you help.  

---

## 0 answers

