Skip to main content

getTemplateByMarker

Getting one template object by marker.

Templates?.getTemplateByMarker( marker?, langCode? );

Minimal example

const value = await Templates.getTemplateByMarker('my-marker')
Schema

marker(required): string
The unique marker of the template to retrieve
example: "template_12345"

langCode: string
Language code. Default: "en_US"
example: "en_US"

This method retrieves a single template object based on its identifier (marker) from the API. It returns a Promise that resolves to a template object.

Example response

{
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
Schema

id: number
The unique identifier of the position.
example: 12345

attributeSetIdentifier: string | null
Set of attributes id.
example: "attribute_set_1"

title: string
The name of the template.
example: "Product Template"

generalTypeId: number
General type Entity id.
example: 67890

identifier: string
The textual identifier for the record field.
example: "template_12345"

version: number
The version number of the object.
example: 1

generalTypeName: Types
General type name.
example:

"product"

attributeValues: AttributeType
Attribute values from the index (represented as a pair of user attribute id: attribute value).

position: number
The position of the object.
example: NaN