Skip to content

Instantly share code, notes, and snippets.

@seb-thomas
Created February 3, 2016 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seb-thomas/fd5c867819c7c1d426b6 to your computer and use it in GitHub Desktop.
Save seb-thomas/fd5c867819c7c1d426b6 to your computer and use it in GitHub Desktop.
Code for getting all field attr to entry
{% 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 | inspect }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment