sanity-io / visual-editing

https://visual-editing-studio.sanity.build
MIT License
29 stars 16 forks source link

Allow subdomain variations in presentation #992

Open fcisio opened 4 months ago

fcisio commented 4 months ago

Hi, I'm using the presentation editor and it seems I have a use case that is not yet supported.

My project has both languages and markets. https://<market>.domain.com/<language>/pathname

The languages work fine as they are simple path prefixes. But the markets being subdomains is what causes issues.

When inside the editor and navigating to a specific subdomain, I get many obscure errors that don't provide much relevant context. I do know it's not a DNS or CORS issue.

Describe the solution you'd like

I think the solution would be to add some more options in the presentationTool() plugin. Perhaps a allowedSubdomains array? If subdomains are defined, there could be a dropdown in the editor to select them.

Describe alternatives you've considered

I have considered implementing alternate logic to pull market data via URL query params, but that's a bit too hacky to my taste.

Additional context

Screenshot 2024-02-23 at 3 07 05 PM
markomitranic commented 2 months ago

FYI I opened a similar question with some examples here https://github.com/sanity-io/visual-editing/issues/1280