Let's say I have 5 Craft fields named "item1" thru "item5."
Instead of writing out each variable...
{{ entry.item1 }}
{{ entry.item2 }}
{{ entry.item3 }}
{{ entry.item4 }}
{{ entry.item5 }}
How can I create a loop to do this for me?
I've tried this...
{% for i is 1..5 %}
{{ entry.item ~ loop.index }}
{% endfor %}
But it returns the error:
Craft\EntryModel and its behaviors do not have a method or closure named "item".