getTemplatesPreviewByMarker
Getting one template object by marker
TemplatePreviews.getTemplatesPreviewByMarker(marker, langCode)
const value = await TemplatePreviews.getTemplatePreviewByMarker('my-marker')
Schema
marker:* string
Product marker
example: my-marker
langCode: string
Optional parameter language code
example: en_US
This method retrieves a single template object based on its textual identifier (marker) from the API. It returns a Promise that resolves to a TemplatePreviewsEntity object.
Example return:
{
"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
}
Schema
id: number
object identifier
example: 1764
version number
object's version number of modification
example: 10
identifier: string
textual identifier for a field in the record
example: catalog
proportion ITemplateProportionType
template proportion parameters
example:
{
"horizontal": {
"height": 200,
"weight": 10,
"marker": "horizontal",
"title": "Horizontal",
"alignmentType": "left"
},
"vertical": {
"height": 10,
"weight": 200,
"marker": "vertical",
"title": "Vertical",
"alignmentType": "left"
},
"square": {
"marker": "square",
"title": "Square",
"slide": 3,
"alignmentType": "center"
}
}
title: string
template name
example: page template
positionId object
position number
example: 0
positionId: number
position object identifier
example: 12