<p>This is because I was on a category page not an entry page, so the entry variable didn't exist!</p>

CC BY-SA 3.0
2015-08-14T13:41:47.333Z
2015-08-14T13:41:47.333Z
Mark Gifford
<p>When I'm using devmode to dump out a twig variable the site will no longer work saying that entry = NULL.</p>

<p>This only happens when I have some twig logic at the top of my template e.g.</p>

<pre><code>    {% set metaDescription = entry.metaDescription %}
    {% set metaPageTitle = entry.metaPageTitle %}
</code></pre>

<p>do I need to move this logic elsewhere in order for devMode to work?</p>

<templating><entry><devmode>
Devmode entry variable NULL
# Devmode entry variable NULL

(Asked by: username_0 on 2015-08-14)

When I'm using devmode to dump out a twig variable the site will no longer work saying that entry = NULL.
This only happens when I have some twig logic at the top of my template e.g.
    {% set metaDescription = entry.metaDescription %}
    {% set metaPageTitle = entry.metaPageTitle %}

do I need to move this logic elsewhere in order for devMode to work?

**Tags:** templating, entry, devmode


---

## 1 answers

### Answer by username_0 on 2015-08-14. Score: 1

This is because I was on a category page not an entry page, so the entry variable didn't exist!


---

