<p>I think you can use this:</p>

<pre><code>{% for field in entry.subentry[0].getFieldLayout().getFields() %}
    {{ field.getField().name }} {# or .handle #}
{% endfor %}
</code></pre>

<p>You might try a great little plugin called <a href="https://github.com/adrianmacneil/craft-inspector" rel="nofollow">inspector</a> that prints out all of the attributes and methods of an object using either filter <code>{{ entry.subentry|inspect }}</code> or method <code>{{ inspect(entry.subentry) }}</code> syntax. Its output is a little cleaner than dump, and nice for following the rabbit-hole.</p>

CC BY-SA 3.0
2014-11-16T18:24:48.100Z
2014-11-16T18:24:48.100Z
Douglas McDonald
<p>How do you get a list of the fields that are on an entry?</p>

<p>I tried <code>{{ dump(entry.subentry) }}</code> but that isn't any help ...</p>

<entries><field>
How to get a list of fields on an entry
# How to get a list of fields on an entry

(Asked by: username_0 on 2014-11-16)

How do you get a list of the fields that are on an entry?

I tried `{{ dump(entry.subentry) }}` but that isn't any help ...

**Tags:** entries, field

---

## 1 answers

### Answer by username_1 on 2014-11-16. Score: 3

I think you can use this:
{% for field in entry.subentry[0].getFieldLayout().getFields() %}
    {{ field.getField().name }} {# or .handle #}
{% endfor %}

You might try a great little plugin called inspector that prints out all of the attributes and methods of an object using either filter {{ entry.subentry|inspect }} or method {{ inspect(entry.subentry) }} syntax. Its output is a little cleaner than dump, and nice for following the rabbit-hole.


---

