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

CC BY-SA 3.0
2017-05-27T05:25:45.173Z
2017-05-27T05:25:45.173Z
Stephen Lewis
<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>

CC BY-SA 3.0
2017-05-26T03:16:21.497Z
Can you add the template code you're using?
Matt Stein
<saveentry><plugin-guestentries>
Single type for entry submission on error loses entry object
# 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:

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:
 '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.


---

