2

This might be a very simple question but I am pretty new to Craft with a EE background. Basically, I have a global containing contact details that use a matrix field, I’m literally just looking for the syntax to loop through the matrix blocks.

I have tried similar code to the successful matrix fields I have in other areas, but how do I reference the particular global? This is what I’ve attempted with no success:

{% for block in contactDetails %}
    {{ block.location }}
    {{ block.address }}
{% endfor %}

contactDetails being the name of the global. I’m sure this is very simple I just can’t figure it out.

6
{% for block in contactDetails.myMatrixField %}
     {{ block.location }}
     {{ block.address }}
{% endfor %}
|improve this answer|||||
  • 1
    The handle for my global and my matrix field were stupidly the same. Thanks Jpea! – simonsweeney Jul 8 '14 at 14:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.