Why Live Preview is only on document save? #13582
-
👨🦰Hello, I need some help to understand if I have misunderstood the live preview feature. I had assumed that Live preview allows you to see the result before saving your changes and making them public. But from what I see (and from what happens when I had implemented the feature with This defeats what I perceive to be the purpose of the feature. So I must be wrong. What I am missing? From here (https://payloadcms.com/docs/live-preview/server) I see: ![]() Is there really no way to update the data on edit? I thought I could send the changes through the iframe post message communication (as decap/netlify-cms do/used to do). (Maybe I need to setup versioning and autosaving drafts to get a realtime live preview which doesn't publish as you edit?) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You nailed it here! That's exactly how live preview is designed to work in Payload - using drafts with autosave. At least that's how I believe server-side live preview works, AFAIR client-side works differently and might not need drafts/autosave. |
Beta Was this translation helpful? Give feedback.
-
The documentation is also quite misleading in the sense that it makes you think it's enough to go through the steps, and everything should work. But apparently you need to modify your queries to |
Beta Was this translation helpful? Give feedback.
Yes client side live preview does not need saving of document. The setup is a bit different, see https://payloadcms.com/docs/live-preview/client