getAllTemplates
Getting all template objects of a specific type.
Templates?.getAllTemplates( langCode? );
Minimal example
const value = await Templates.getAllTemplates()
Schema
langCode: string
Language code. Default: "en_US"
example: "en_US"
This method retrieves all template objects grouped by types from the API. It returns a Promise that resolves to an object GroupedTemplatesObject, which contains an array of template objects.
Example response
{
"catalog_page": [
{
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 2
}
],
"product_preview": [
{
"id": 5,
"attributeSetIdentifier": null,
"title": "Product preview",
"generalTypeId": 5,
"identifier": "product_preview",
"version": 0,
"generalTypeName": "product_preview",
"attributeValues": {},
"position": 1
}
],
"product_block": [
{
"id": 6,
"attributeSetIdentifier": null,
"title": "block template",
"generalTypeId": 10,
"identifier": "block-template",
"version": 0,
"generalTypeName": "product_block",
"attributeValues": {},
"position": 3
}
]
}