<p>I've finally found this shame fault. I created a variable named footer to control the layout – that's not that good in combination with a field named footer.</p>

<p>Sorry for stealing your time...</p>

CC BY-SA 3.0
2018-01-11T20:34:16.473Z
2018-01-11T20:34:16.473Z
Malte
<p>I do not see anything obviously wrong with your code, but something that has caught me out many times is a misspelling of field names, so be sure your twig code matches your field names exactly. One thing that is a bit odd is the error message references "footerContent", but that does not appear in your code. </p>

CC BY-SA 3.0
2018-01-08T15:57:24.807Z
Ok, thanks.. that's because I've tested changing the field handle to ensure that's the right name.. (I've corrected it)
Malte
CC BY-SA 3.0
2018-01-08T21:37:57.547Z
I just put your code on a test page and it seems to work fine.
Roi Agneta
CC BY-SA 3.0
2018-01-08T00:40:53.367Z
2018-01-08T00:40:53.367Z
Roi Agneta
<p>What could be the reason for this error when I’m targeting a global field?: </p>

<p><code>Impossible to access an attribute ("footer") on a boolean variable ("").</code></p>

<p>I created a global set <em>Footer</em> with a matrix field also named <em>Footer</em>, I'm trying to get its content via:</p>

<pre><code>{% for block in footer.footer %}
  {% if block.type == "column" %}
    &lt;div&gt;
      &lt;h4&gt;{{ block.headline }}&lt;/h4&gt;
      &lt;div&gt;{{ block.columnContent }}&lt;/div&gt;
    &lt;/div&gt;
  {% endif %}
{% endfor %}
</code></pre>

CC BY-SA 3.0
2018-01-07T17:26:05.330Z
We need more of your code in order to help you.  How do you fetch the global set, what are you doing with it after your loop
Robin Schambach
CC BY-SA 3.0
2018-01-07T17:54:07.207Z
@RobinSchambach Thanks for the advice, I added some lines. Do that help?
Malte
CC BY-SA 3.0
2018-01-07T18:07:57.467Z
Your code is actually correct. I created the set `footer` with the matrix field `footer` and the block `column` with the fields `headline` and `columnContent` and copied your code as it is with `{% set footer = craft.globals.getSetByHandle('footer')%}` and it works. You error must be related to your fields/your field handles or the field types. Since we don't know your layout we can't really help you
Robin Schambach
CC BY-SA 3.0
2018-01-08T16:11:26.107Z
Could you show us how you fetch your global set? Because of your error message I get the feeling you didn't fetch the set
Robin Schambach
<templating><matrix><globals>
Access global field content
# Access global field content

(Asked by: username_0 on 2018-01-07)

What could be the reason for this error when I’m targeting a global field?: 
Impossible to access an attribute ("footer") on a boolean variable ("").
I created a global set Footer with a matrix field also named Footer, I'm trying to get its content via:
{% for block in footer.footer %}
  {% if block.type == "column" %}
    
      {{ block.headline }}
      {{ block.columnContent }}
    
  {% endif %}
{% endfor %}

**Tags:** templating, matrix, globals

> **Comments:**
> **username_1**: We need more of your code in order to help you.  How do you fetch the global set, what are you doing with it after your loop  
> **username_0**: @RobinSchambach Thanks for the advice, I added some lines. Do that help?  
> **username_1**: Your code is actually correct. I created the set `footer` with the matrix field `footer` and the block `column` with the fields `headline` and `columnContent` and copied your code as it is with `{% set footer = craft.globals.getSetByHandle('footer')%}` and it works. You error must be related to your fields/your field handles or the field types. Since we don't know your layout we can't really help you  
> **username_1**: Could you show us how you fetch your global set? Because of your error message I get the feeling you didn't fetch the set  

---

## 2 answers

### Answer by username_0 on 2018-01-11. Score: 1 | Accepted answer

I've finally found this shame fault. I created a variable named footer to control the layout – that's not that good in combination with a field named footer.

Sorry for stealing your time...


---

### Answer by username_2 on 2018-01-08. Score: 2

I do not see anything obviously wrong with your code, but something that has caught me out many times is a misspelling of field names, so be sure your twig code matches your field names exactly. One thing that is a bit odd is the error message references "footerContent", but that does not appear in your code.

> **Comments:**
> **username_0**: Ok, thanks.. that's because I've tested changing the field handle to ensure that's the right name.. (I've corrected it)  
> **username_2**: I just put your code on a test page and it seems to work fine.  

---

