Answers.Body: <p>Not sure why you're referencing "entry" in your code, I'd think the code should be:</p>
  
  <pre><code>{% for block in footer.links %}
    {% if block.navigationLinks | length %}
      &lt;h3&gt;{{ block.navigationHeadline }}&lt;/h3&gt;
      {# Show the navigationHeadline if it has links #}
      &lt;ul&gt;
        {% for row in block.navigationLinks %}
          &lt;li&gt;{{ row.linkLabel }} - {{ row.linkUrl }}&lt;/li&gt;
        {% endfor %}
      &lt;/ul&gt;
    {% endif %}
  {% endfor %}
  </code></pre>
  
  <p>So, "links" is the matrix on your "footer" global, which you can access from anywhere. You loop over that, get a block for each matrix block, and access "navigationHeadline" and "navigationLinks" through that.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-03-17T22:08:15.930Z
Answers.LastActivityDate: 2015-03-17T22:08:15.930Z
Answers.UserDisplayName: André Elvan
Body: <p>I have created a Global with the handle 'footer', which contains a Matrix field 'links' and I'm trying to get this into a template, but I can't seem to get this to work.</p>
  
  <p>The 'links' Matrix contains a Block Type 'navigation' with a Plain Text field 'navigationHeadline' and a Table field 'navigationLinks'. The table field contains 'linkLabel' and 'linkUrl' columns (see attached image).</p>
  
  <p>I'm ultimately creating my navigation in a Global with a Headline and some Links and the Headline should only appear if each block has some links;</p>
  
  <pre><code>{% for block in entry.links %}
      {% if entry.navigationLinks | length %}
          &lt;h3&gt;{{ block.navigationHeadline }}&lt;/h3&gt;
          {# Show the navigationHeadline if it has links #}
          &lt;ul&gt;
              {% for row in entry.navigationLinks %}
                  &lt;li&gt;{{ row.linkLabel }} - {{ row.linkUrl }}&lt;/li&gt;
              {% endfor %}
          &lt;/ul&gt;
      {% endif %}
  {% endfor %}
  </code></pre>
  
  <p>I wondered if anyone can help me resolve my obvious errors. Thanks.</p>
  
  <p><img src="https://i.sstatic.net/OoNwe.png" alt="Screenshot of Global"></p>
  
Tags: <matrix><globals><table-field>
Title: Accessing a Matrix field in a Global
ThreadText: # Accessing a Matrix field in a Global
  
  (Asked by: username_0 on 2015-03-17)
  
  I have created a Global with the handle 'footer', which contains a Matrix field 'links' and I'm trying to get this into a template, but I can't seem to get this to work.
  
  The 'links' Matrix contains a Block Type 'navigation' with a Plain Text field 'navigationHeadline' and a Table field 'navigationLinks'. The table field contains 'linkLabel' and 'linkUrl' columns (see attached image).
  
  I'm ultimately creating my navigation in a Global with a Headline and some Links and the Headline should only appear if each block has some links;
  
  ```
  {% for block in entry.links %}
      {% if entry.navigationLinks | length %}
          <h3>{{ block.navigationHeadline }}</h3>
          {# Show the navigationHeadline if it has links #}
          <ul>
              {% for row in entry.navigationLinks %}
                  <li>{{ row.linkLabel }} - {{ row.linkUrl }}</li>
              {% endfor %}
          </ul>
      {% endif %}
  {% endfor %}
  
  ```
  
  I wondered if anyone can help me resolve my obvious errors. Thanks.
  
  ![Screenshot of Global](https://i.sstatic.net/OoNwe.png)
  
  **Tags:** matrix, globals, table-field
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-03-17. Score: 7 | Accepted answer
  
  Not sure why you're referencing "entry" in your code, I'd think the code should be:
  
  ```
  {% for block in footer.links %}
    {% if block.navigationLinks | length %}
      <h3>{{ block.navigationHeadline }}</h3>
      {# Show the navigationHeadline if it has links #}
      <ul>
        {% for row in block.navigationLinks %}
          <li>{{ row.linkLabel }} - {{ row.linkUrl }}</li>
        {% endfor %}
      </ul>
    {% endif %}
  {% endfor %}
  
  ```
  
  So, "links" is the matrix on your "footer" global, which you can access from anywhere. You loop over that, get a block for each matrix block, and access "navigationHeadline" and "navigationLinks" through that.
  
  
  ---
  
  