<p>Field groups are not specific to a particular channel or channel entry. They are just an arbitrary organization within the control panel for ease of use. What you would be looking for are the fields defined for the particular field layout for that entry. I.e.:</p>

<pre><code>{# loop through the fields in the entries fieldLayout Model #}
{% for fieldLayoutField in entry.getFieldLayout().getFields() %}

    {# get the field Model from the fieldId #}
    {% set field = craft.fields.getFieldById(fieldLayoutField.fieldId) %}

    {# print the field handle and the field content  #}
    {{ field.handle }} : {{ entry.getContent()[field.handle] }}

{% endfor %}
</code></pre>

<p>By the way, there is an excellent plugin called '<a href="https://github.com/adrianmacneil/craft-inspector" rel="noreferrer">Inspector</a>' written by Adrian McNeal that displays all methods/attributes/properties of an object or variable, which can be very useful for figuring out what your dealing with.</p>

<p>UPDATE: It has been brought to my attention that<code>fieldLayoutField.fieldId</code> has been discontinued in favor of <code>fieldLayoutField.id</code>. While not tested, if the above does not work, please try the following instead:</p>

<pre><code> {% set field = craft.fields.getFieldById(fieldLayoutField.id)
</code></pre>

CC BY-SA 3.0
2017-07-05T03:12:51.990Z
This code has already proven useful, so thanks a lot. I wonder if it could be modified to go a level deeper: what I'm trying to get at is the fields within Entry fields when those entry fields are part of a Single. 
As in, if you have a Photos field, get it to show photos.caption, things a level down.
David Rhoden
CC BY-SA 3.0
2017-07-11T03:46:15.137Z
@DavidRhoden Each field type is quite different, so you would probably have to add some switch conditionals to access specific field properties. But doable. Might be better to ask a new question if you are looking for something specific.
Douglas McDonald
CC BY-SA 4.0
2014-10-05T18:56:47.613Z
2018-07-05T17:30:05.230Z
2018-07-05T17:30:05.230Z
Douglas McDonald
<p>How do I modify a template to include a loop that displays all custom fields that I added to the field group that the current entry belongs through? I know how to display the fields individually by calling their name, but how to display all fields belonging to the group?</p>

<templating><field>
How to display all fields belonging to current entry?
# How to display all fields belonging to current entry?

(Asked by: username_0 on 2014-10-05)

How do I modify a template to include a loop that displays all custom fields that I added to the field group that the current entry belongs through? I know how to display the fields individually by calling their name, but how to display all fields belonging to the group?

**Tags:** templating, field


---

## 1 answers

### Answer by username_1 on 2014-10-05. Score: 27 | Accepted answer

Field groups are not specific to a particular channel or channel entry. They are just an arbitrary organization within the control panel for ease of use. What you would be looking for are the fields defined for the particular field layout for that entry. I.e.:
{# loop through the fields in the entries fieldLayout Model #}
{% for fieldLayoutField in entry.getFieldLayout().getFields() %}

    {# get the field Model from the fieldId #}
    {% set field = craft.fields.getFieldById(fieldLayoutField.fieldId) %}

    {# print the field handle and the field content  #}
    {{ field.handle }} : {{ entry.getContent()[field.handle] }}

{% endfor %}

By the way, there is an excellent plugin called 'Inspector' written by Adrian McNeal that displays all methods/attributes/properties of an object or variable, which can be very useful for figuring out what your dealing with.
UPDATE: It has been brought to my attention thatfieldLayoutField.fieldId has been discontinued in favor of fieldLayoutField.id. While not tested, if the above does not work, please try the following instead:
 {% set field = craft.fields.getFieldById(fieldLayoutField.id)

> **Comments:**
> **username_2**: This code has already proven useful, so thanks a lot. I wonder if it could be modified to go a level deeper: what I'm trying to get at is the fields within Entry fields when those entry fields are part of a Single.  As in, if you have a Photos field, get it to show photos.caption, things a level down.  
> **username_1**: @DavidRhoden Each field type is quite different, so you would probably have to add some switch conditionals to access specific field properties. But doable. Might be better to ask a new question if you are looking for something specific.  

---

