Skip to main content

Embed 360 spins in Editor X

WIP - EDITOR X ARTICLE Create 2 articles:

  • EditorX
  • Wix Studio (took over from EditorX in April 2024) INTRO TEXT & LOGO DEMO OF 360 SPIN

How to embed spins in an Editor X website​

1. Open the Editor X dashboard and enable Dev Mode (Dev Mode > Turn on Dev Mode):

Enable Dev Mode in Editor X dashboard

2. Click "Add Elements" (1), then click "Embed & Social" (2), then click "Custom Element" (3), then select "Custom Element" (4):

Select Custom Element

3. Paste the following Script code to the end of the file:

Paste Script to end of file

const createSirvScript = function createSirvScript() {
if (!document.querySelector('#sirv-viewer-script')) {
const sirvScript = document.createElement('script');
sirvScript.id = 'sirv-viewer-script';
sirvScript.src = 'https://scripts.sirv.com/sirvjs/v3/sirv.js';
document.head.appendChild(sirvScript);
}
};

class SirvViewer extends HTMLElement {
connectedCallback() {
createSirvScript();
let assetSources = this.dataset.slides || "";
let multipleAssetSources = "";

if (!/<.*>/.test(assetSources)) {
multipleAssetSources = assetSources;
assetSources = "";
}
this.innerHTML = `<div className="Sirv" data-options="${this.dataset.options || ""}" data-src="${multipleAssetSources}">${assetSources}</div>`;
}
}
customElements.define('sirv-viewer', SirvViewer);

4. Click 'Set Attributes':

Click the Set Attributes button

5. In the "Attribute name" field enter data-slides and in the "Value" field enter your Sirv spin code. Then click "Set". This is spin code example:

Enter attribute name and value
6. Update Element Attributes: Velo file Click "Choose Source" (1), then select "Velo file" (2), select wix-default-custom-element.js (3), then enter sirv-viewer in the Tag name field (4):

Select Velo file element attribute

7. Update Element Attributes: Server URL Select "Server URL" (1), then enter sirv-viewer in the Tag name field (2), then reference https://scripts.sirv.com/platforms/wix/sirv-viewer-element-for-wix.js in the Server URL field (3), then select "Update" (4):

Update Server URL element attribute

Try Sirv today​

Get started now! Create your free Sirv account. You'll receive 5 GB for 30 days, after which you can choose a special $99/year Wix plan or use a free light usage ad-supported plan.