<p>Assuming <code>seitenContent</code> is a matrix field, here's why it returns a <code>null</code> value: If you query for an entry all trivial fields are loaded right away, however non-trivial fields types like matrix, entry, asset and so on are only loaded if they are actually accessed in the Twig template (lazy loading). This is why <code>{{ dump(kundenmeinungen) }}</code> shows a <code>null</code> value on that field.</p>
<p>PS: If you would eager load that matrix field it would show the actual content in the dump command. To eager load a relational field you would do something like this:</p>
<pre><code>{% set kundenmeinungen = craft.entries.section('unterseiten').slug('kundenmeinungen').with(['seitenContent']).one() %}
</code></pre>
<p>Note that <code>kundenmeinungen.seitenContent</code> is an array then. You have to access it like <code>kundenmeinungen.seitenContent[0]</code>.</p>

CC BY-SA 4.0
2021-06-03T16:11:32.423Z
2021-06-03T16:11:32.423Z
Johannes
<p>When trying to query a specific single entry in a section I get back a result but all the fields inside that result are nulled.</p>
<p>This</p>
<pre><code>{% set kundenmeinungen = craft.entries.section('unterseiten').slug('kundenmeinungen').one() %}

{{ dump(kundenmeinungen) }}
</code></pre>
<p>returns multiple fields that all look like this even though there is content inside the cms:</p>
<pre><code>[&quot;seitenContent&quot;]=&gt; NULL
</code></pre>
<p>Any ideas?</p>

CC BY-SA 4.0
2021-06-03T15:17:35.037Z
What happens if you call `dump(kundenmeinung.seitenContent)`? Do you have more than one site configured?
Johannes
CC BY-SA 4.0
2021-06-03T16:03:33.363Z
@Johannes you saved me. I got it working by using this:

`{% set kundenmeinungen = craft.entries.section('unterseiten').slug('kundenmeinungen').one() %}

{{ dump(kundenmeinungen.seitenContent.type('textbewertungMitBild').all()) }}`
Kris
CC BY-SA 4.0
2021-06-03T16:05:48.607Z
Looks like `seitenContent` is not a trivial field type but maybe a matrix field?
Johannes
CC BY-SA 4.0
2021-06-03T16:07:21.517Z
@Johannes yes it was a matrix field. All the other fields were easy to get but the matrix field not. I struggled for hours with this.
Kris
CC BY-SA 4.0
2021-06-03T16:13:23.170Z
Oh crap, hours? Well, don't hesitate to create questions here. Also, have a look at the Craft Discord server.
Johannes
CC BY-SA 4.0
2021-06-03T16:22:48.440Z
@Johannes ah didn't kniw there's a discord. Yes I spent 2 hours on it lol
Kris
<entry><query>
Entry query returns all fields with NULL
# Entry query returns all fields with NULL

(Asked by: username_0 on 2021-06-03)

When trying to query a specific single entry in a section I get back a result but all the fields inside that result are nulled.
This
{% set kundenmeinungen = craft.entries.section('unterseiten').slug('kundenmeinungen').one() %}

{{ dump(kundenmeinungen) }}

returns multiple fields that all look like this even though there is content inside the cms:
["seitenContent"]=> NULL

Any ideas?

**Tags:** entry, query
> **Comments:**
> **username_1**: What happens if you call `dump(kundenmeinung.seitenContent)`? Do you have more than one site configured?  
> **username_0**: @Johannes you saved me. I got it working by using this:  `{% set kundenmeinungen = craft.entries.section('unterseiten').slug('kundenmeinungen').one() %}  {{ dump(kundenmeinungen.seitenContent.type('textbewertungMitBild').all()) }}`  
> **username_1**: Looks like `seitenContent` is not a trivial field type but maybe a matrix field?  
> **username_0**: @Johannes yes it was a matrix field. All the other fields were easy to get but the matrix field not. I struggled for hours with this.  
> **username_1**: Oh crap, hours? Well, don't hesitate to create questions here. Also, have a look at the Craft Discord server.  
> **username_0**: @Johannes ah didn't kniw there's a discord. Yes I spent 2 hours on it lol  

---

## 1 answers

### Answer by username_1 on 2021-06-03. Score: 1 | Accepted answer

Assuming seitenContent is a matrix field, here's why it returns a null value: If you query for an entry all trivial fields are loaded right away, however non-trivial fields types like matrix, entry, asset and so on are only loaded if they are actually accessed in the Twig template (lazy loading). This is why {{ dump(kundenmeinungen) }} shows a null value on that field.
PS: If you would eager load that matrix field it would show the actual content in the dump command. To eager load a relational field you would do something like this:
{% set kundenmeinungen = craft.entries.section('unterseiten').slug('kundenmeinungen').with(['seitenContent']).one() %}

Note that kundenmeinungen.seitenContent is an array then. You have to access it like kundenmeinungen.seitenContent[0].


---

