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

getTemplatesPreviewByMarker

الحصول على كائن قالب واحد بواسطة العلامة

TemplatePreviews.getTemplatesPreviewByMarker(marker, langCode)

const value = await TemplatePreviews.getTemplatePreviewByMarker('my-marker')
المخطط

marker:* سلسلة
علامة المنتج
مثال: my-marker

langCode: سلسلة
رمز اللغة (معامل اختياري)
مثال: en_US

تسترجع هذه الطريقة كائن قالب واحد بناءً على معرفه النصي (العلامة) من واجهة برمجة التطبيقات. تعيد Promise التي تحل إلى كائن TemplatePreviewsEntity.

مثال على الإرجاع:

{
"id": 1,
"version": 0,
"identifier": "preview-templates",
"attributeValues": {
"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": "نموذج المعاينة",
"position": 1
}
المخطط

id: رقم
معرف الكائن
مثال: 1764

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

identifier: سلسلة
المعرف النصي لحقل في السجل
مثال: catalog

proportion ITemplateProportionType
معلمات نسبة القالب
مثال:

{
"horizontal": {
"height": 200,
"weight": 10,
"marker": "horizontal",
"title": "أفقي",
"alignmentType": "left"
},
"vertical": {
"height": 10,
"weight": 200,
"marker": "vertical",
"title": "عمودي",
"alignmentType": "left"
},
"square": {
"marker": "square",
"title": "مربع",
"slide": 3,
"alignmentType": "center"
}
}

title: سلسلة
اسم القالب
مثال: قالب الصفحة

positionId كائن
رقم الموضع
مثال: 0

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