3

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

1

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 for it, though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.