Answers.Body: <p>This should do it:</p>
  
  <pre><code>&lt;ul&gt;
      {% if craft.request.isLivePreview() %}
  
          {# if it's Live Preview, grab even the disabled entries #}
          {% set entries = craft.entries.section('mySection').status(null).find() %}
  
      {% else %}
  
          {# not Live Preview, so just grab enabled entries #}
          {% set entries = craft.entries.section('mySection').find() %}
  
      {% endif %}
  
      {% for entry in entries %}
          &lt;li&gt;{{ entry.title }}&lt;/li&gt;
      {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-02T10:12:24.557Z
Answers.Text: Thanks for your answer!
  Now I see everything in the Live Preview, but also the entries which are disabled.
  So is it possible to show a disabled page in a Live Preview but not the disabled entries of this page?
Answers.UserDisplayName: Jonathan Schiffner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-02T16:22:47.093Z
Answers.Text: `.status(null)` controls whether it will grab disabled entries or not, so you can take that out if you only want enabled. But if you do that, then this whole thing is pointless because that's the default behavior.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-03T12:56:03.500Z
Answers.Text: Okay so in the Live Preview it is not possible to see if an matrix entry in a disabled page is activated or not?
Answers.UserDisplayName: Jonathan Schiffner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-04T03:45:47.567Z
Answers.Text: I guess I'm not following. What's a "matrix entry"?  Do you mean you want to check if a Matrix custom field has a block that is disabled on a Live Preview request?
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-04T11:21:29.177Z
Answers.Text: Oh sorry! Yes, that is what I mean.
Answers.UserDisplayName: Jonathan Schiffner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-04T16:23:24.793Z
Answers.Text: You're probably running into this bug, then: http://feedback.craftcms.com/forums/285224-bugs/suggestions/11307681-disabled-matrix-blocks-still-display-in-live-previ
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-07-01T18:26:27.877Z
Answers.LastActivityDate: 2016-07-01T18:26:27.877Z
Answers.UserDisplayName: Brad Bell
Answers.Body: <p>You can combine <code>.status( null )</code> with the <code>isLivePreview</code> property on <code>craft.request</code>. More info can be found in the <a href="https://craftcms.com/docs/templating/craft.request#isLivePreview" rel="nofollow">docs</a>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-22T13:42:53.837Z
Answers.Text: Yes I know, but so I see in the Live Preview also the entry's which are disabled. 
  But I want to see in the Live Preview the page(whether it's disabled or not) and only the enabled entry's. You know what I mean?
Answers.UserDisplayName: Jonathan Schiffner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-22T22:41:14.230Z
Answers.Text: Jonathan: it sounds like you have other issues?  The live preview will work on any entry, disabled or not, as long as it has a template associated with it. Your template code determines what happens when you want to show other entries.  If your live preview isn't working, the template code on that page might be throwing an error, which may be why you're not getting the live preview.
Answers.UserDisplayName: RitterKnight
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-24T19:45:23.940Z
Answers.Text: Sorry I see you can misunderstand my question. I just updated it
Answers.UserDisplayName: Jonathan Schiffner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-21T21:05:40.897Z
Answers.LastActivityDate: 2016-05-21T21:05:40.897Z
Answers.UserDisplayName: Luke Pearce
Answers.Body: <p>Jonathan, you have a lot going on with your code, including nested for loops,  which is probably beyond the scope of the Q&amp;A format here.</p>
  
  <p>If it were me, I'd try to simplify what you have until you get the basics working.  If Live Preview isn't working, there's probably other things going on with your code.</p>
  
  <p>Make a copy of your code and do a simple <code>for</code> loop just to start for troubleshooting:</p>
  
  <pre><code>&lt;ul&gt;
  {% for currentEntry in craft.entries.section('aboutus') %}
      &lt;li&gt;{{currentEntry}}&lt;/li&gt;
  {% endfor %}
  &lt;/ul&gt;
  </code></pre>
  
  <p>That will spit out the title of the entry and only display the entries that are enabled. If that works, then you keep building up from there until you find the source of what's going on.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-08T11:21:05.353Z
Answers.Text: Thanks for your answer! I tried your code and it's the same result. If the page is `enabled` I can see the first entry. If the page is `disabled` I can't see anything. An idea what the error can be?
  There is also nothing in the error log.
Answers.UserDisplayName: Jonathan Schiffner
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-05-25T20:39:19.520Z
Answers.LastActivityDate: 2016-05-25T20:39:19.520Z
Answers.UserDisplayName: RitterKnight
Body: <p>The whole page is disabled in the backend. Like in this screenshot: <a href="https://i.sstatic.net/bKaXe.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/bKaXe.png" alt="enter image description here"></a></p>
  
  <p>Now I can't see anything in the Live Preview. </p>
  
  <p>My code starts with: <code>{% for entry in craft.entries.section('aboutus') %}</code></p>
  
  <p>If I set <code>.status(null)</code> I see everything in the Live Preview, but also the entries which are disabled.</p>
  
  <p>So is it possible to show a disabled page in a Live Preview but not the disabled entries of this page?</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>In the Live Preview I can see all outside of this for loop <code>{% for entry in craft.entries.section('aboutus') %}</code> but nothing inside.</p>
  
  <p>I uploaded my code <a href="http://jsfiddle.net/zoy2hj0c" rel="nofollow noreferrer">here</a>.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-24T23:09:05.847Z
Comments.Text: Is ``entry`` your actual variable? Craft actually defines ``entry`` as the current entry so if you're trying to use some of the current entry's data inside the loop, you'll get whatever entry the ``for`` loop is iterating over (and possibly a syntax error).  You might want to change that to ``aboutUsCurrentEntry`` or something. I know Live Preview uses the ``entry`` variable as well so you might be bumping up against a conflict there...
Comments.UserDisplayName: RitterKnight
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-25T18:08:41.013Z
Comments.Text: Thanks, but this does not changes anything. Do you have an other idea?
Comments.UserDisplayName: Jonathan Schiffner
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-25T18:09:38.290Z
Comments.Text: It would help to show what code is in your for loop.
Comments.UserDisplayName: RitterKnight
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-05-25T18:13:42.310Z
Comments.Text: I uploaded it here: https://jsfiddle.net/zoy2hj0c/
Comments.UserDisplayName: Jonathan Schiffner
Tags: <templating><live-preview>
Title: Show Live Preview even if whole page is disabled
ThreadText: # Show Live Preview even if whole page is disabled
  
  (Asked by: username_0 on 2016-05-21)
  
  The whole page is disabled in the backend. Like in this screenshot: [![enter image description here](https://i.sstatic.net/bKaXe.png)](https://i.sstatic.net/bKaXe.png)
  
  Now I can't see anything in the Live Preview.
  
  My code starts with: `{% for entry in craft.entries.section('aboutus') %}`
  
  If I set `.status(null)` I see everything in the Live Preview, but also the entries which are disabled.
  
  So is it possible to show a disabled page in a Live Preview but not the disabled entries of this page?
  
  **UPDATE**
  
  In the Live Preview I can see all outside of this for loop `{% for entry in craft.entries.section('aboutus') %}` but nothing inside.
  
  I uploaded my code [here](http://jsfiddle.net/zoy2hj0c).
  
  **Tags:** templating, live-preview
  
  > **Comments:**
  > **username_1**: Is ``entry`` your actual variable? Craft actually defines ``entry`` as the current entry so if you're trying to use some of the current entry's data inside the loop, you'll get whatever entry the ``for`` loop is iterating over (and possibly a syntax error).  You might want to change that to ``aboutUsCurrentEntry`` or something. I know Live Preview uses the ``entry`` variable as well so you might be bumping up against a conflict there...  
  > **username_0**: Thanks, but this does not changes anything. Do you have an other idea?  
  > **username_1**: It would help to show what code is in your for loop.  
  > **username_0**: I uploaded it here: https://jsfiddle.net/zoy2hj0c/  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_2 on 2016-07-01. Score: 2 | Accepted answer
  
  This should do it:
  
  ```
  <ul>
      {% if craft.request.isLivePreview() %}
  
          {# if it's Live Preview, grab even the disabled entries #}
          {% set entries = craft.entries.section('mySection').status(null).find() %}
  
      {% else %}
  
          {# not Live Preview, so just grab enabled entries #}
          {% set entries = craft.entries.section('mySection').find() %}
  
      {% endif %}
  
      {% for entry in entries %}
          <li>{{ entry.title }}</li>
      {% endfor %}
  </ul>
  
  ```
  
  > **Comments:**
  > **username_0**: Thanks for your answer! Now I see everything in the Live Preview, but also the entries which are disabled. So is it possible to show a disabled page in a Live Preview but not the disabled entries of this page?  
  > **username_2**: `.status(null)` controls whether it will grab disabled entries or not, so you can take that out if you only want enabled. But if you do that, then this whole thing is pointless because that's the default behavior.  
  > **username_0**: Okay so in the Live Preview it is not possible to see if an matrix entry in a disabled page is activated or not?  
  > **username_2**: I guess I'm not following. What's a "matrix entry"?  Do you mean you want to check if a Matrix custom field has a block that is disabled on a Live Preview request?  
  > **username_0**: Oh sorry! Yes, that is what I mean.  
  > **username_2**: You're probably running into this bug, then: http://feedback.craftcms.com/forums/285224-bugs/suggestions/11307681-disabled-matrix-blocks-still-display-in-live-previ  
  
  ---
  
  ### Answer by username_3 on 2016-05-21. Score: 2
  
  You can combine `.status( null )` with the `isLivePreview` property on `craft.request`. More info can be found in the [docs](https://craftcms.com/docs/templating/craft.request#isLivePreview).
  
  > **Comments:**
  > **username_0**: Yes I know, but so I see in the Live Preview also the entry's which are disabled.  But I want to see in the Live Preview the page(whether it's disabled or not) and only the enabled entry's. You know what I mean?  
  > **username_1**: username_0: it sounds like you have other issues?  The live preview will work on any entry, disabled or not, as long as it has a template associated with it. Your template code determines what happens when you want to show other entries.  If your live preview isn't working, the template code on that page might be throwing an error, which may be why you're not getting the live preview.  
  > **username_0**: Sorry I see you can misunderstand my question. I just updated it  
  
  ---
  
  ### Answer by username_1 on 2016-05-25. Score: 1
  
  username_0, you have a lot going on with your code, including nested for loops, which is probably beyond the scope of the Q&A format here.
  
  If it were me, I'd try to simplify what you have until you get the basics working. If Live Preview isn't working, there's probably other things going on with your code.
  
  Make a copy of your code and do a simple `for` loop just to start for troubleshooting:
  
  ```
  <ul>
  {% for currentEntry in craft.entries.section('aboutus') %}
      <li>{{currentEntry}}</li>
  {% endfor %}
  </ul>
  
  ```
  
  That will spit out the title of the entry and only display the entries that are enabled. If that works, then you keep building up from there until you find the source of what's going on.
  
  > **Comments:**
  > **username_0**: Thanks for your answer! I tried your code and it's the same result. If the page is `enabled` I can see the first entry. If the page is `disabled` I can't see anything. An idea what the error can be? There is also nothing in the error log.  
  
  ---
  
  