getTemplatesPreviewById
الحصول على كائن قالب واحد بواسطة المعرف
TemplatePreviews.getTemplatesPreviewById(id, langCode)
const value = await TemplatePreviews.getTemplatePreviewById(1764)
Schema
id:* رقم
علامة المنتج
مثال: 1764
langCode: سلسلة
معامل اختياري لرمز اللغة
مثال: en_US
تسترجع هذه الطريقة كائن قالب واحد بناءً على معرفه (id) من واجهة برمجة التطبيقات. تعيد Promise التي تحل إلى كائن TemplatePreviewsEntity.
مثال على الإرجاع:
{
"id": 1,
"version": 0,
"identifier": "preview-templates",
"attributeValues": {
"en_US": {
"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: رقم
معرف الكائن
مثال: 1764
version رقم
رقم إصدار الكائن للتعديل
مثال: 10
identifier: سلسلة
معرف نصي لحقل في السجل
مثال: catalog
proportion ITemplateProportionType
معاملات نسبة القالب
مثال:
{
"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: سلسلة
اسم القالب
مثال: قالب الصفحة
position كائن
رقم الموضع
مثال: 0
positionId: رقم
معرف كائن الموضع
مثال: 12