Answers.Body: <p>From <a href="https://github.com/pixelandtonic/GuestEntries/blob/master/README.md" rel="nofollow noreferrer">the README</a>:</p>
  
  <blockquote>
    <p>If there is a validation error on the entry, then the page will be reloaded with an <code>entry</code> variable available to it...</p>
  </blockquote>
  
  <p>You can override the variable name by setting the <code>entryVariable</code> config setting, as follows:</p>
  
  <pre><code>&lt;?php
  
  // File: craft/config/guestentries.php
  
  return [
      'entryVariable' =&gt; 'guestEntry',
  ];
  </code></pre>
  
  <p>Once you've done that, the page entry model will be available as <code>entry</code>, and the "guest entries" entry model (containing any validation errors) will be available as <code>guestEntry</code>.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-05-27T05:25:45.173Z
Answers.LastActivityDate: 2017-05-27T05:25:45.173Z
Answers.UserDisplayName: Stephen Lewis
Body: <p>I have created a contact form inside a single entry type 'contact' for front end submissions.
  This lets me display editing options for title and body and display the form.</p>
  
  <p>When submitting the form, the entry object ( eg entry.title ) disappears and no title or body  content is shown - just the form with its corresponding errors.</p>
  
  <p>So submitting it seems to lose the entry - is this because it is returning the saved entry model and not the single that it is on? </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-05-26T03:16:21.497Z
Comments.Text: Can you add the template code you're using?
Comments.UserDisplayName: Matt Stein
Tags: <saveentry><plugin-guestentries>
Title: Single type for entry submission on error loses entry object
ThreadText: # Single type for entry submission on error loses entry object
  
  (Asked by: username_0 on 2017-05-25)
  
  I have created a contact form inside a single entry type 'contact' for front end submissions.
  This lets me display editing options for title and body and display the form.
  
  When submitting the form, the entry object ( eg entry.title ) disappears and no title or body content is shown - just the form with its corresponding errors.
  
  So submitting it seems to lose the entry - is this because it is returning the saved entry model and not the single that it is on?
  
  **Tags:** saveentry, plugin-guestentries
  
  > **Comments:**
  > **username_1**: Can you add the template code you're using?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-05-27. Score: 2 | Accepted answer
  
  From [the README](https://github.com/pixelandtonic/GuestEntries/blob/master/README.md):
  
  > If there is a validation error on the entry, then the page will be reloaded with an `entry` variable available to it...
  
  You can override the variable name by setting the `entryVariable` config setting, as follows:
  
  ```
  <?php
  
  // File: craft/config/guestentries.php
  
  return [
      'entryVariable' => 'guestEntry',
  ];
  
  ```
  
  Once you've done that, the page entry model will be available as `entry`, and the "guest entries" entry model (containing any validation errors) will be available as `guestEntry`.
  
  
  ---
  
  