Answers.Body: <p>Change:</p>
  
  <pre><code>{% for entry in craft.entries.section('flashback') %}
  </code></pre>
  
  <p>To:</p>
  
  <pre><code>{% for entry in craft.entries.section('flashback').status(null) %}
  </code></pre>
  
  <p>The 2nd one will grab all entries regardless of their enabled/disabled status.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-18T08:52:43.610Z
Answers.Text: This works, but now the page is shown in the frontend even if it is disabled.
Answers.UserDisplayName: Jonathan Schiffner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-20T10:50:08.603Z
Answers.Text: Is there any way to show the entry only in the Live Preview and not on the real page?
Answers.UserDisplayName: Jonathan Schiffner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-20T18:30:42.033Z
Answers.Text: Not sure I'm following, but it sounds like you might need to wrap some of your template logic in a `if craft.request.isLivePreview()` conditional?
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-21T10:34:19.183Z
Answers.Text: Yes this is what I'm searching for.
Answers.UserDisplayName: Jonathan Schiffner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-17T21:05:10.257Z
Answers.LastActivityDate: 2016-05-17T21:05:10.257Z
Answers.UserDisplayName: Brad Bell
Body: <p>When the entry is disabled, the Live Preview only shows things which are outer of the main loop. This is a part of my code:</p>
  
  <pre><code>{% include "header.html" %}
  {% for entry in craft.entries.section('flashback') %}
      &lt;section id="intro" style="background-image: url('{{ entry.heroImage.first().getUrl() }}');"&gt;
          &lt;h1&gt;Flashback&lt;/h1&gt;
      &lt;/section&gt;
  ...
  {% endfor %}
  {% include 'footer.html' %}
  </code></pre>
  
  <p>The <code>header</code> and the <code>footer</code> are visible but the <code>section</code> and <code>headline</code> not.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-17T20:50:20.680Z
Comments.Text: Can you elaborate with a bit more template code?  "outer of the main loop" sounds like some things are displaying outside of a loop and things inside aren't? It'd be helpful to point out exactly what's happening in the code and what you're expecting to see.
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-17T21:03:32.383Z
Comments.Text: Done. I hope this helps
Comments.UserDisplayName: Jonathan Schiffner
Tags: <live-preview>
Title: Live Preview error when entry is disabled
ThreadText: # Live Preview error when entry is disabled
  
  (Asked by: username_0 on 2016-05-17)
  
  When the entry is disabled, the Live Preview only shows things which are outer of the main loop. This is a part of my code:
  
  ```
  {% include "header.html" %}
  {% for entry in craft.entries.section('flashback') %}
      <section id="intro" style="background-image: url('{{ entry.heroImage.first().getUrl() }}');">
          <h1>Flashback</h1>
      </section>
  ...
  {% endfor %}
  {% include 'footer.html' %}
  
  ```
  
  The `header` and the `footer` are visible but the `section` and `headline` not.
  
  **Tags:** live-preview
  
  > **Comments:**
  > **username_1**: Can you elaborate with a bit more template code?  "outer of the main loop" sounds like some things are displaying outside of a loop and things inside aren't? It'd be helpful to point out exactly what's happening in the code and what you're expecting to see.  
  > **username_0**: Done. I hope this helps  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-05-17. Score: 3 | Accepted answer
  
  Change:
  
  ```
  {% for entry in craft.entries.section('flashback') %}
  
  ```
  
  To:
  
  ```
  {% for entry in craft.entries.section('flashback').status(null) %}
  
  ```
  
  The 2nd one will grab all entries regardless of their enabled/disabled status.
  
  > **Comments:**
  > **username_0**: This works, but now the page is shown in the frontend even if it is disabled.  
  > **username_0**: Is there any way to show the entry only in the Live Preview and not on the real page?  
  > **username_1**: Not sure I'm following, but it sounds like you might need to wrap some of your template logic in a `if craft.request.isLivePreview()` conditional?  
  > **username_0**: Yes this is what I'm searching for.  
  
  ---
  
  