plugins icon indicating copy to clipboard operation
plugins copied to clipboard

[Web Previews]: "Live" preview when saving/publishing doesn't work

Open vanska opened this issue 11 months ago • 1 comments

The Web Previews plugin documentations contains an example (cover video) where the preview instantly updates on save/publish but it doesn't seem to work and the editor needs to press the refresh icon after saving/publishing. Is this something the plugin should provide (e.g. reload the preview on save/publish) or do I need to somehow implement it myself?

vanska avatar Mar 14 '24 15:03 vanska

Hello @vanska

To have live updates you need to use the Real Time Updates API https://www.datocms.com/docs/real-time-updates-api That will update the page automatically upon an update in Dato.

If you'd like to see an example of the implementation of this API you can check this Demo right here: https://github.com/datocms/next-landing-page-demo/tree/main deployable here https://www.datocms.com/marketplace/starters/marketing-website

More specifically, you can see how we use the Real Time Updates API right here, for the draft pages: https://github.com/datocms/next-landing-page-demo/blob/64766f4e3787c688f7b5f6264c64e1910c85050b/components/Blog/RealTime/RealTimePost.tsx#L8

marcelofinamorvieira avatar Mar 18 '24 15:03 marcelofinamorvieira