getPageById
الحصول على كائن صفحة واحدة تحتوي على معلومات حول النماذج، الكتل، القوائم المرتبطة بالصفحة.
Pages?.getPageById( id?, langCode? );
مثال بسيط
const value = await Pages.getPageById(1);
المخطط
id(required): number
المعرف الفريد للصفحة التي سيتم جلبها
مثال: 1
langCode: string
رمز اللغة. الافتراضي: "en_US"
مثال: "en_US"
تسترجع هذه الطريقة كائن صفحة واحدة بناءً على معرفها (id) من واجهة برمجة التطبيقات. تعيد Promise التي تحل إلى كائن الصفحة، مع ا لاعتماد على نوع الصفحة التي يتم إرجاعها.
مثال على الاستجابة
{
"id": 8,
"parentId": null,
"pageUrl": "blog",
"depth": 0,
"localizeInfos": {
"title": "مدونة",
"menuTitle": "مدونة",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"forms": [],
"blocks": [],
"type": "common_page",
"templateIdentifier": "template",
"attributeSetIdentifier": "page",
"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": []
}
},
"isSync": true,
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "قالب",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
}
المخطط
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