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

getBlocksByPageUrl

استلام كائنات لكتلة ذات صلة من خلال عنوان URL للصفحة.

الوصف

احصل على كائنات PositionBlock لنموذج ذي صلة من خلال عنوان URL. يعيد Promise يتم حله إلى مصفوفة من كائنات IPositionBlock.

Pages.getBlocksByPageUrl(

url, langCode

);

مخطط المعلمات

المخطط

url(مطلوب): string
عنوان URL للصفحة
مثال: "about"

langCode: string
رمز اللغة. الافتراضي: "en_US"
مثال: "en_US"

أمثلة

مثال بسيط

const response = await Pages.getFormsByPageUrl('shop');

مثال مع السمات

const response = await Pages.getFormsByPageUrl('shop', 'en_US');

استجابة المثال

[
{
"id": 1,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "كتلة المنتج"
},
"version": 0,
"position": 1,
"identifier": "product_block",
"type": "product_block",
"templateIdentifier": null,
"isVisible": true,
"isSync": false,
"attributeValues": {},
"countElementsPerRow": 1,
"quantity": 1
},
{
"id": 4,
"attributeSetIdentifier": "block",
"localizeInfos": {
"title": "اختبار"
},
"version": 8,
"position": 2,
"identifier": "test",
"type": "common_block",
"templateIdentifier": null,
"isVisible": true,
"isSync": true,
"attributeValues": {
"block-text": {
"type": "string",
"value": "بعض النصوص",
"position": 0,
"additionalFields": []
},
"interval": {
"type": "timeInterval",
"value": [
{
"values": [
{
"id": "bbc82c9f-1bc4-4c86-b83c-c062016eb7cb",
"dates": [
"2025-04-14T00:00:00.000Z",
"2025-04-14T00:00:00.000Z"
],
"times": [
[
{
"hours": 9,
"minutes": 0
},
{
"hours": 10,
"minutes": 0
}
],
[
{
"hours": 10,
"minutes": 0
},
{
"hours": 11,
"minutes": 0
}
],
[
{
"hours": 11,
"minutes": 0
},
{
"hours": 12,
"minutes": 0
}
],
"..."
],
"intervals": [],
"exceptions": [],
"intervalId": "c6466cd8-c55d-4583-97c5-42b684210f12",
"inEveryWeek": true,
"inEveryMonth": true,
"timeIntervals": [
[
"2025-04-07T09:00:00.000Z",
"2025-04-07T10:00:00.000Z"
],
[
"2025-04-07T10:00:00.000Z",
"2025-04-07T11:00:00.000Z"
],
[
"2025-04-07T11:00:00.000Z",
"2025-04-07T12:00:00.000Z"
],
"..."
]
}
],
"intervalId": "c6466cd8-c55d-4583-97c5-42b684210f12"
}
],
"position": 1,
"additionalFields": []
}
}
}
]

مخطط الاستجابة

المخطط: IPositionBlock[]

id: number
معرف الكائن.
مثال: 1

attributeSetIdentifier: string | null
مجموعة معرفات السمات.
مثال: "block"

localizeInfos: ILocalizeInfo
اسم الصفحة، مع الأخذ في الاعتبار التوطين.

version: number
رقم إصدار الكائن.
مثال: 0

position: number
موضع الكائن.
مثال: 1

identifier: string
المعرف النصي لحقل السجل.
مثال: "product_block"

type: Types
نوع الصفحة.
مثال:

"product"

templateIdentifier: string | null
معرف المستخدم للقالب المرتبط.
مثال: null

isVisible: boolean
علامة رؤية الصفحة.
مثال: true

isSync: boolean
إشارة إلى فهرسة الصفحة.
مثال: false

attributeValues: AttributeType
مصفوفة من قيم السمات من الفهرس (ممثلة كزوج من معرف سمة المستخدم: قيمة السمة).
مثال:

{
"block-text": {
"type": "string",
"value": "بعض النصوص",
"position": 0,
"additionalFields": []
}
}

countElementsPerRow: number
عدد العناصر المعروضة في كل صف في الكتلة، إذا كان ذلك مناسبًا.
مثال: 3

quantity: number
عدد الصفحات في الكتلة.
مثال: NaN