<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>

CC BY-SA 3.0
2016-05-18T08:52:43.610Z
This works, but now the page is shown in the frontend even if it is disabled.
Jonathan Schiffner
CC BY-SA 3.0
2016-05-20T10:50:08.603Z
Is there any way to show the entry only in the Live Preview and not on the real page?
Jonathan Schiffner
CC BY-SA 3.0
2016-05-20T18:30:42.033Z
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?
Brad Bell
CC BY-SA 3.0
2016-05-21T10:34:19.183Z
Yes this is what I'm searching for.
Jonathan Schiffner
CC BY-SA 3.0
2016-05-17T21:05:10.257Z
2016-05-17T21:05:10.257Z
Brad Bell
<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>

CC BY-SA 3.0
2016-05-17T20:50:20.680Z
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.
Brad Bell
CC BY-SA 3.0
2016-05-17T21:03:32.383Z
Done. I hope this helps
Jonathan Schiffner
<live-preview>
Live Preview error when entry is disabled
# 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') %}
    
        Flashback
    
...
{% 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.  

---

