Set the metal from the page URL
Add a layer name and a variation name to the embed address, and the viewer opens with that metal.
The viewer can open with one material already selected. To do this, add a layer name and a variation name to the embed address. This works in an iframe address and in a direct link.
Before you start
- The model must have material options. Refer to Material Configurator. A model with no options has nothing to change.
- You need the embed address of the model. Refer to Create an embed.
Find the two names
Step 1 of 4
- Open the model in the editor.
- Look at the tabs at the bottom of the configurator. Each tab is one layer, for example
Metal. - Right-click a tab and select Edit to see the exact layer name.
- Hold the pointer on a variation icon. The editor shows the variation name, for example
Gold.
All 4 steps are done.
Add the names to the address
Step 1 of 4
- Add
?to the end of the embed address. - Add the layer name, then
=, then the variation name. - For one more layer, add
&and the next pair. - If the address already contains
?, start with&.
All 4 steps are done.
text
https://ijewel3d.com/drive/files/MODEL_ID/embedded?Metal=Gold
https://ijewel3d.com/drive/files/MODEL_ID/embedded?Band=Rose-Gold&Gem=Ruby
https://ijewel3d.com/drive/files/embedded?tag=pid-12345&scope=FOLDER_ID&Metal=GoldNames must match exactly
Type each name exactly as the editor shows it. Upper case and lower case letters must match. If a name does not match, the viewer ignores it.
Change the metal with no page reload
Use #? in place of ?. The viewer then applies the material immediately and does not load again. Your web developer can connect this to the option buttons on your product page:
html
<button onclick="setMaterial('Metal', 'White-Gold')">White gold</button>
<script>
const iframe = document.getElementById('viewer-frame');
function setMaterial(layer, name) {
const url = new URL(iframe.src);
url.hash = `?${layer}=${name}`;
iframe.src = url.toString();
}
</script>