getTemplatesPreviewByMarker
Getting one template object by marker.
Description
This method retrieves a single template object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a template preview object ITemplatePreviewsEntity.
TemplatePreviews.getTemplatesPreviewByMarker(
marker*,
langCode
);
Parameters schema
Schema
marker(required): string
The unique product marker used to identify the template. If not provided, a default behavior or error may occur
example: "template_12345"
langCode: string
Language code. Default: "en_US"
example: "en_US"
Examples
Minimal example
const response = await TemplatePreviews.getTemplatePreviewByMarker('my-marker');
Example with attributes
const response = await TemplatePreviews.getTemplatePreviewByMarker('my-marker', 'en_US');
Example response
{
"id": 1,
"version": 0,
"identifier": "preview-templates",
"attributeValues": {
"marker": {
"value": "",
"type": "string",
"position": 1,
"isProductPreview": false,
"isIcon": false,
"attributeFields": {
"marker": {
"type": "string",
"value": "test"
}
}
}
},
"attributeSetIdentifier": "my-set",
"proportion": {
"vertical": {
"width": "2",
"height": "3",
"alignmentType": "leftTop",
"marker": "v"
},
"horizontal": {
"width": "234",
"height": "324",
"alignmentType": "middleBottom",
"marker": "h"
},
"square": {
"side": "3",
"alignmentType": "middleBottom",
"marker": "s"
}
},
"title": "Preview Templates",
"position": 1
}