Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide site resolver without having preview mode enabled #521

Open
yannickoo opened this issue Aug 29, 2023 · 3 comments
Open

Provide site resolver without having preview mode enabled #521

yannickoo opened this issue Aug 29, 2023 · 3 comments

Comments

@yannickoo
Copy link

yannickoo commented Aug 29, 2023

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

Screenshot 2023-08-30 at 00 06 20

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.
@yannickoo
Copy link
Author

#496

@yannickoo
Copy link
Author

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 🎉

➡️ next_disable_iframe.zip

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.

@iNeoxx
Copy link

iNeoxx commented Jan 4, 2024

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 🎉

➡️ next_disable_iframe.zip

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.

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 :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants