Skip to main content

getTemplateByType

Getting all template objects, grouped by types.

Templates?.getTemplateByType( type?, langCode? );

Minimal example

const value = await Templates.getTemplateByType('forCatalogProducts')
Schema

type(required): Types
The type of templates to retrieve. This parameter specifies the category or classification of templates being requested
example: "product"

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

This method retrieves a single template object based on its identifier (id) 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