Direct Link for Preview Mode

I write a Frontend for Cockpit and i add a Navigation for User there is logged in Backend from Cockpit, and i will directly switch to Preview Mode if i click on Edit Page.

In the momment i linking to …/collections/entry/staticpages/5c0ac149663335a080000346 for Example but i will something like …/collections/entry/staticpages/5c0ac149663335a080000346/preview have you any Idea to do this?

Hey @fschuermeyer, not sure if understood your doubt!

You want to switch from your frontend to cockpit to edit the collection?

The preview mode of Cockpit does the opposite, when you are editing a collection if you have a url configured for preview, it will load that in an iframe and dispatching the entry data. What I usually do is on my FE (e.g. react) have a route for handling the preview.

Yes i will Switch from the Frontend to the Edit Collection Preview.

The Route for the Preview mode its not the Problem for the Iframe.
The Direct Switch from Front to Preview(Edit) Collection its my Problem @pauloamgomes

Not sure if that will be possible, because the preview is triggered inside the collection entry… one solution maybe is to built your own preview route in Cockpit that mimics the collection entry one but has the preview already active, but seems a bit of work

Yes i have the Idea, with the JavaScript to Trigger the Event, i must experiment something this the event i have a Idea to trigger the Event for the Preview Mode on a Hash like collection/entry/artikel/id#preview or something like this :slight_smile:

If i finde a god Soulution i post it here for the Othere Persons :slight_smile:

1 Like