About Editor URLs
On occasion, your app might want to redirect a site builder to their site's editor or to preview their site with any unpublished changes - for example, to lead them to make changes in your app's settings panel in the editor, or to review changes to the app or the site.
Before you begin
It’s important to note the following points before starting to code:
- Embedded script extensions won't be displayed in the preview.
Use cases
Terminology
- Editor: The platform site builders' use to build and edit their sites. Wix offers 3 editors for site builders:
- Wix Studio
- Wix Editor
- Editor X - partially deprecated
- Preview: A feature that enables site builders to see what any changes made on their site (in the editor, or in your app) will look like to visitors, without publishing the site. Wix recommends that site builders preview their sites to test how new changes and updates look before publishing them.
Sample flows
This article shares some possible use cases your app could support, as well as an example flow that could support each use case. You're certainly not limited to these use cases, but they can be a helpful jumping off point as you plan your app's implementation.
Direct site builders to their site editor
You might choose to direct site builders from within your app to the site editor, for example to place a visual extension in the site.
- Include a call to action that redirects to the editor - for example, a button.
- Whenever the site builder clicks the button, call the Get Editor URLs endpoint.
- Redirect the site builder to the URL provided in the
editorUrl
parameter.
Direct site builders to preview the latest changes
If a site builder makes changes to the app's behavior or UI, you might choose to direct them to preview those changes using Wix's site preview feature. This flow is equally relevant if you choose to direct them to preview changes made directly in the site editor.
- Include a call to action that redirects to preview the site - for example, a button.
- Whenever the site builder clicks the button, call the Get Editor URLs endpoint.
- Redirect the site builder to the URL provided in the
previewUrl
parameter.
Note: The site preview feature will not be able to display any embedded script extensions.
The Editor URLs object provides a list of editor-related URLs, including a link to the site's editor interface (one of Wix Studio, Wix Editor, or Editor X), and a link to preview the site with the latest changes made in the editor.
This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retrieves a site's Editor URLs.