Is there a working example of the preview button? #1875
-
I'm having some difficulty understanding how the preview button works. I usually reference the current Payload website for how things are done, but the preview functionality is currently broken on it. None of the examples seem to use preview either. At one time it seems that preview did work on the Payload website: These commits got me most of the way there. I'm successfully passing the JWT token to the static props, it redirects me to the slug's page, but I continue to see the published content. I'm not using GraphQL, just plain ol' REST.
Any ideas? Been working on this for days. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Ahhh yeah the payload site is on next 13’s app folder, which doesn’t support preview yet… Or at least it didn’t when we built the site. I haven’t checked into it lately. Regardless I think you are pointing to a good example that we need to make and we can do it with good old Next’s pages folder. I think we could probably get started on this first thing next week because I think it’s super necessary. Give us a bit here and I’ll get back to you! |
Beta Was this translation helpful? Give feedback.
-
I think you might need draft=true parameters in the url to show the draft content alongside with JWT token |
Beta Was this translation helpful? Give feedback.
Ahhh yeah the payload site is on next 13’s app folder, which doesn’t support preview yet… Or at least it didn’t when we built the site. I haven’t checked into it lately. Regardless I think you are pointing to a good example that we need to make and we can do it with good old Next’s pages folder.
I think we could probably get started on this first thing next week because I think it’s super necessary. Give us a bit here and I’ll get back to you!