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

getRootPages

الحصول على جميع كائنات الصفحات من المستوى الأعلى (parentId = null).

الوصف

تسترجع هذه الطريقة جميع كائنات الصفحات من المستوى الأعلى من واجهة برمجة التطبيقات. تعيد Promise التي تحل إلى مصفوفة من كائنات الصفحات من المستوى الأعلى أو مصفوفة فارغة [] إذا لم يكن هناك بيانات.

Pages.getRootPages(langCode);

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

المخطط

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

أمثلة

مثال بسيط

const response = await Pages.getRootPages();

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

[
{
"id": 8,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "blog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "مدونة",
"menuTitle": "مدونة",
"htmlContent": "",
"plainContent": ""
},
"position": 1,
"isVisible": true,
"products": 0,
"childrenCount": 1,
"type": "common_page",
"templateIdentifier": "template",
"isSync": true,
"attributeValues": {
"text": {
"type": "string",
"value": "بعض النص",
"position": 0,
"additionalFields": []
},
"number": {
"type": "integer",
"value": 0,
"position": 1,
"additionalFields": []
},
"real": {
"type": "real",
"value": "",
"position": 2,
"additionalFields": []
},
"float": {
"type": "float",
"value": 0,
"position": 3,
"additionalFields": []
}
},
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "قالب",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
},
{
"id": 10,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "catalog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "كتالوج",
"menuTitle": "كتالوج",
"htmlContent": "",
"plainContent": ""
},
"position": 2,
"isVisible": true,
"products": 3,
"childrenCount": 0,
"type": "catalog_page",
"templateIdentifier": "template",
"isSync": true,
"attributeValues": {
"text": {
"type": "string",
"value": "نص الكتالوج",
"position": 0,
"additionalFields": []
},
"number": {
"type": "integer",
"value": 0,
"position": 1,
"additionalFields": []
},
"real": {
"type": "real",
"value": "",
"position": 2,
"additionalFields": []
},
"float": {
"type": "float",
"value": 0,
"position": 3,
"additionalFields": []
}
},
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "قالب",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
}
]

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

المخطط: IPagesEntity[]

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

parentId: number | null
معرف الصفحة الأم، إذا كان يحتوي على null، فإنه يمثل الصفحة من المستوى الأعلى.
مثال: 10

pageUrl: string
رابط الصفحة الفريد.
مثال: "blog"

depth: number
عمق تعشيش الصفحة بالنسبة إلى parentId.
مثال: 10

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

{
"title": "مدونة",
"menuTitle": "مدونة",
"htmlContent": "",
"plainContent": ""
}

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

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

"common_page"

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

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

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

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

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

template: any
كائن القالب.

position: number
رقم العنصر (لترتيب العناصر).
مثال: 2

config: any
إعدادات الإخراج لصفحات الكتالوج.
مثال:

{
"rowsPerPage": 1,
"productsPerRow": 1
}

products: number
عدد المنتجات المرتبطة بالصفحة.
مثال: 0

childrenCount: number
عدد الأطفال.
مثال: 1