setRemoteMockup
- Less than a minute to read
Like changeMockup, this command replaces the mockup image in the editor. However, instead of a path on the Customer's Canvas back end, this method takes a URL to a remote image you want to insert. It is extremely useful when the mockup image is "generated".
Important
This method works only if you already specified a regular image, not a PSD file, as a mockup in the initial command.
Params
setRemoteMockup
takes an array of objects with the following parameters:
surfaceIndex
- which surface to modify. If omitted, the currently visible surface is modified.mockup
- eitherup
ordown
, which stands for overlaying and background mockups.url
- a URL to the image to use as a mockup
For the complete list of parameters, you can refer to ISetRemoteMockup.
Example
{
"type": "ajax",
"name": "mockup-recolor",
"params": {
...
}
},
{
"type": "design-editor",
"name": "editor",
"params": {
"initial": { ... },
"setRemoteMockup": [{
"surfaceIndex": 0,
"mockup": "down",
"url": "{{ $['mockup-recolor'].response || '' }}"
}]
}
}