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

getBlockByMarker

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

Blocks.getBlockByMarker(marker, langCode, offset, limit)

const value = await Blocks.getBlockByMarker('my-marker')
Schema

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

langCode: سلسلة
رمز اللغة
مثال: en_US

offset: رقم
معامل للتصفح. الافتراضي 0
مثال: 0

limit: رقم
معامل للتصفح. الافتراضي 30
مثال: 30

تُرجع هذه الطريقة كائن كتلة واحد بواسطة العلامة.

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

{
"id": 1764,
"localizeInfos": {
"en_US": {
"title": "My block"
}
},
"customSettings": {
"sliderDelay": 0,
"sliderDelayType": "",
"productConfig": {
"quantity": 2,
"sortType": "By_ID",
"sortOrder": "DESC",
"countElementsPerRow": 10
},
"similarProductRules": [
{
"property": "Descending",
"includes": "",
"keywords": "",
"strict": ""
}
],
"condition": {
"name": "title"
}
},
"version": 10,
"identifier": "catalog",
"position": 192,
"productPageUrls": [
"23-laminat-floorwood-maxima"
],
"isVisible": true,
"attributeValues": {
"en_US": {
"marker": {
"value": "",
"type": "string",
"position": 1,
"isProductPreview": false,
"isIcon": false,
"attributeFields": {
"marker": {
"type": "string",
"value": "test"
}
}
}
}
},
"type": "forNewsPage",
"templateIdentifier": null,
"attributeSetIdentifier": "my-attributes-sets"
}
Schema

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

localizeInfos: CommonLocalizeInfos
اسم الكتلة مع مراعاة التوطين
مثال:

{
"en_US": {
"title": "My block"
}
}

customSettings: BlockCustomSettings
إعدادات فردية لأنواع مختلفة من الكتل
BlockCustomSettings مثال:

{
"sliderDelay": 0,
"sliderDelayType": "",
"productConfig": {
"quantity": 2,
"sortType": "By_ID",
"sortOrder": "DESC",
"countElementsPerRow": 10
},
"similarProductRules": [
{
"property": "Descending",
"includes": "",
"keywords": "",
"strict": ""
}
],
"condition": {
"name": "title"
}
}

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

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

position: رقم
رقم الموضع (للتصنيف)
مثال: 192

productPageUrls: أي
مصفوفة من أجزاء URL الفريدة (بعد آخر "/") - الفئات التي يمكن أخذ المنتجات منها (اختياري)
مثال:

[ "23-laminat-floorwood-maxima" ]

isVisible: بولياني
مؤشر الرؤية (التوفر) للكتلة
مثال: true

attributeValues: Record<string, string>
مصفوفة من قيم السمات من الفهرس (النوع، القيمة، مصفوفة من الحقول الإضافية للصفة)
مثال:

{
"en_US": {
"marker": {
"value": "",
"type": "string",
"position": 1,
"isProductPreview": false,
"isIcon": false,
"attributeFields": {
"marker": {
"type": "string",
"value": "test"
}
}
}
}
}

type: سلسلة
نوع الكتلة
مثال: forNewsPage
Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service ]

attributeSetId: رقم
معرف مجموعة السمات المستخدمة
مثال: 7

position: رقم
رقم الموضع (للتصنيف)
مثال: 192

templateIdentifier: سلسلة
علامة القالب المستخدمة بواسطة الكتلة (يمكن أن تكون null)
مثال: null