Answers.Body: <pre><code>{% for block in contactDetails.myMatrixField %}
       {{ block.location }}
       {{ block.address }}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-08T14:51:04.183Z
Answers.Text: The handle for my global and my matrix field were stupidly the same. Thanks Jpea!
Answers.UserDisplayName: simonsweeney
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-08T14:48:52.257Z
Answers.LastActivityDate: 2014-07-08T14:48:52.257Z
Answers.UserDisplayName: jpea
Body: <p>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.</p>
  
  <p>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:</p>
  
  <pre><code>{% for block in contactDetails %}
      {{ block.location }}
      {{ block.address }}
  {% endfor %}
  </code></pre>
  
  <p><code>contactDetails</code> being the name of the global. I’m sure this is very simple I just can’t figure it out.</p>
  
Tags: <matrix>
Title: Looping through a Global with a Matrix field
ThreadText: # Looping through a Global with a Matrix field
  
  (Asked by: username_0 on 2014-07-08)
  
  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.
  
  **Tags:** matrix
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-07-08. Score: 6 | Accepted answer
  
  ```
  {% for block in contactDetails.myMatrixField %}
       {{ block.location }}
       {{ block.address }}
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: The handle for my global and my matrix field were stupidly the same. Thanks username_1!  
  
  ---
  
  