انتقل إلى المحتوى الرئيسي

getTemplatePreviews

الحصول على جميع كائنات القالب

TemplatePreviews.getTemplatePreviews(langCode)

const value = await TemplatePreviews.getTemplatePreviews()
Schema

langCode: string
معامل اختياري لرمز اللغة
مثال: en_US

تسترجع هذه الطريقة جميع كائنات القالب من واجهة برمجة التطبيقات. تعيد 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: number
معرف الكائن
مثال: 1764

version number
رقم إصدار الكائن للتعديل
مثال: 10

identifier: string
معرف نصي لحقل في السجل
مثال: 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: string
اسم القالب
مثال: page template

position object
رقم الموضع
مثال: 0

positionId: number
معرف كائن الموضع
مثال: 12