Answers.Body: <p>My understanding is you have to save an entry first before you can use live preview.</p>
  
  <p>Brandon says as much in his answer here as well:<br>
  <a href="https://craftcms.stackexchange.com/a/12091/103">https://craftcms.stackexchange.com/a/12091/103</a> </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-03T05:07:18.163Z
Answers.Text: Thanks for the link. What is odd though is that in Brandon's answer he says it does not matter if the entry is enabled or not. However, if I save and disable the entry, the same behaviour takes place. If I enable the entry then the live preview is fine again.
Answers.UserDisplayName: Mike
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-03T05:09:07.467Z
Answers.Text: It could be something in your template code that is explicitly hiding disabled entries?? Or perhaps a bug.
Answers.UserDisplayName: Anna_MediaGirl
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-08T02:57:33.600Z
Answers.Text: Well in testing this more, it seems that when the entry is in disabled mode, the preview always loads the most recent enabled entry - regardless of what section that is from. I cannot see anything else that would prevent this in my template code but that behaviour makes me wonder about how I'm retrieving the entry: {% set entry = craft.entries({ slug: craft.request.getLastSegment() }).first() %}
Answers.UserDisplayName: Mike
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-06-01T22:33:31.287Z
Answers.LastActivityDate: 2016-06-01T22:33:31.287Z
Answers.LastEditDate: 2017-04-13T12:50:59.930Z
Answers.UserDisplayName: Anna_MediaGirl
Body: <p>We have a site where Live Preview only works with entries that have been previously published. When trying to preview entries we're working on (or drafts), we see either the latest entry for that section instead - or sometimes the correct entry template but with other/missing data in it.</p>
  
  <p>Puzzled as to what is going on. There are no console errors.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-01T21:50:28.593Z
Comments.Text: Do you have any Routing which may be affecting it?
Comments.UserDisplayName: Matt P
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-06-03T05:03:44.177Z
Comments.Text: No, I don't. That did occur to me.
Comments.UserDisplayName: Mike
Tags: <live-preview>
Title: Live Preview only works with published entries
ThreadText: # Live Preview only works with published entries
  
  (Asked by: username_0 on 2016-06-01)
  
  We have a site where Live Preview only works with entries that have been previously published. When trying to preview entries we're working on (or drafts), we see either the latest entry for that section instead - or sometimes the correct entry template but with other/missing data in it.
  
  Puzzled as to what is going on. There are no console errors.
  
  **Tags:** live-preview
  
  > **Comments:**
  > **username_1**: Do you have any Routing which may be affecting it?  
  > **username_0**: No, I don't. That did occur to me.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-06-01. Score: 2
  
  My understanding is you have to save an entry first before you can use live preview.
  
  Brandon says as much in his answer here as well:  
  <https://craftcms.stackexchange.com/a/12091/103>
  
  > **Comments:**
  > **username_0**: Thanks for the link. What is odd though is that in Brandon's answer he says it does not matter if the entry is enabled or not. However, if I save and disable the entry, the same behaviour takes place. If I enable the entry then the live preview is fine again.  
  > **username_2**: It could be something in your template code that is explicitly hiding disabled entries?? Or perhaps a bug.  
  > **username_0**: Well in testing this more, it seems that when the entry is in disabled mode, the preview always loads the most recent enabled entry - regardless of what section that is from. I cannot see anything else that would prevent this in my template code but that behaviour makes me wonder about how I'm retrieving the entry: {% set entry = craft.entries({ slug: craft.request.getLastSegment() }).first() %}  
  
  ---
  
  