chapter-three / next-drupal

Next.js for Drupal has everything you need to build a next-generation front-end for your Drupal site: SSG, SSR, and ISR, Multi-site, Authentication, Webforms, Search API, I18n and Preview mode (works with JSON:API and GraphQL).
https://next-drupal.org
MIT License
636 stars 175 forks source link

Preview mode in Drupal has two different states #271

Open ysvahn opened 2 years ago

ysvahn commented 2 years ago

Hello, I am facing a weird behavior in Drupal :

When I click the node title directly in the /admin/content list, I correctly access the preview page with the preview iframe in it. But when I try to access it from inside the node (preview button), the Drupal preview is not displayed at all, only the default "Drupal" preview.

I noticed that it only happens on one of our sites, on the one that is working, the links to the preview page are different but both work :

On the website where one of the preview link is not working it is the exact same, but the second URL does not work, the preview iframe is just not there.

As always, thanks for the hard work 💪

shadcn commented 2 years ago

Do you mean the default Drupal preview button? This is not supported out the box in next-drupal. There's a few workaround to make it work. See also https://www.drupal.org/project/jsonapi_node_preview

The /node/preview/node-id/full path does not render the iframe preview by default.

ysvahn commented 2 years ago

Why is it working on the first website then ? It does work using the /node/preview/node-id/full path so what could be the reason ?

shadcn commented 2 years ago

Hmm you mean you can see the iframe preview at node/preview/uuid/full?

ysvahn commented 2 years ago

Exactly, as weird as it sounds it does show on that page.