Answers.Body: <p>This is because I was on a category page not an entry page, so the entry variable didn't exist!</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-08-14T13:41:47.333Z
Answers.LastActivityDate: 2015-08-14T13:41:47.333Z
Answers.UserDisplayName: Mark Gifford
Body: <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>
  
Tags: <templating><entry><devmode>
Title: Devmode entry variable NULL
ThreadText: # 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!
  
  
  ---
  
  