next-drupal
next-drupal copied to clipboard
Provide site resolver without having preview mode enabled
Hey 👋 I am currently working on a decoupled Drupal and want to say thank for the effort you put into this project here!
After debugging the not working revalidation functionality I could figure out that there was no site resolver stored and the reason for that is that the sites associated with an Entity type configuration is only saved when using Preview Mode.
My next.next_entity_type_config.node.page.yml config file is showing me ⬇️
site_resolver: site_selector
configuration:
sites:
next_js: next_js
Wouldn't it make sense to provide a site selector per entity type config instead of having it tied to the Preview Mode? I don't want to use the Preview Mode but I want to have a site selected for my entity type so I can use the On-demand Revalidation.
⬇️ Alternatively we could also Add #empty_option to Site previewer → Plugin select list so people can disable it there
Another alternative is to empty the preview URL / secret but that leads to the following error ⬇️
The website encountered an unexpected error. Please try again later.
InvalidArgumentException: The URI '' is invalid. You must use a valid URI scheme.
#496
I have found a workaround how to disable the Iframe preview programmatically so I thought it's the best to share the custom module with you. Just unpack it into web/modules/custom and install it and voilà – the Iframe is gone 🎉
Explanation: The module is altering the services and removes the service definition for next.main_content_renderer.html which is responsible for overriding the regular output with the Iframe display.
I have found a workaround how to disable the Iframe preview programmatically so I thought it's the best to share the custom module with you. Just unpack it into
web/modules/customand install it and voilà – the Iframe is gone 🎉Explanation: The module is altering the services and removes the service definition for
next.main_content_renderer.htmlwhich is responsible for overriding the regular output with the Iframe display.
hello, I'm interested in your module because I also want to use the ODR without using Preview Mode but when I install your module nothing happens, the iFrame is still displayed, I don't know if I'm doing something wrong or if it doesn't work anymore :(