<p>Right now the CP Live Preview implementation is very heavily tied to the control panel.  I can't see a easy or clean way to get it to work on a front-end request.</p>

<p>Feel free to make a <a href="https://github.com/craftcms/cms/issues" rel="nofollow noreferrer">feature request</a> for it, though.</p>

CC BY-SA 3.0
2017-04-05T18:08:12.833Z
2017-04-05T18:08:12.833Z
Brad Bell
<p>I am working on an intranet in Craft CMS.
Front-end editing is a very important part of this, and I want to get it perfect.</p>

<p>As it is now, the live preview is perfect for what I want, it provides markup and styling for all field types. If I where to make a custom front-end form for each entry type, including advanced matrix / neo fields etc. the workload would be huge, and I would probably end up doing something similar to what live preview already do.</p>

<p>Therefore I am trying to get live edit to work in front-end, or make it look like it does.</p>

<p>At the moment I just have a link to the CP when pressing "edit" on an entry. And have made use of a hook on afterSave to pick up the front-end url and send the user back to front-end when the entry is saved. This works semi seamless, but I cant figure out a way to trigger the live preview from php, or maybe how to inject some JS when editing an entry after pressing the link in front-end.</p>

<p>So the main question;
Should I keep going with the "trick" to just send the user back and forth between front-end and CP, or should I get the live preview to work front-end? If so, what is the best approach here, I could expose the CP recourses to the front-end, but that sounds like a horrible idea with many concerns.</p>

<p>-- Mathias</p>

<live-preview><craft-features>
Front-end Editing, with Live Preview
# Front-end Editing, with Live Preview

(Asked by: username_0 on 2017-04-05)

I am working on an intranet in Craft CMS.
Front-end editing is a very important part of this, and I want to get it perfect.

As it is now, the live preview is perfect for what I want, it provides markup and styling for all field types. If I where to make a custom front-end form for each entry type, including advanced matrix / neo fields etc. the workload would be huge, and I would probably end up doing something similar to what live preview already do.

Therefore I am trying to get live edit to work in front-end, or make it look like it does.

At the moment I just have a link to the CP when pressing "edit" on an entry. And have made use of a hook on afterSave to pick up the front-end url and send the user back to front-end when the entry is saved. This works semi seamless, but I cant figure out a way to trigger the live preview from php, or maybe how to inject some JS when editing an entry after pressing the link in front-end.

So the main question;
Should I keep going with the "trick" to just send the user back and forth between front-end and CP, or should I get the live preview to work front-end? If so, what is the best approach here, I could expose the CP recourses to the front-end, but that sounds like a horrible idea with many concerns.

-- Mathias

**Tags:** live-preview, craft-features


---

## 1 answers

### Answer by username_1 on 2017-04-05. Score: 1 | Accepted answer

Right now the CP Live Preview implementation is very heavily tied to the control panel. I can't see a easy or clean way to get it to work on a front-end request.

Feel free to make a [feature request](https://github.com/craftcms/cms/issues) for it, though.


---

