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

searchPage

بحث سريع عن كائنات الصفحة مع مخرجات محدودة.

Description

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

Pages.searchPage(

name*, url, langCode

);

Parameters schema

Schema

name(required): string
النص للبحث عن كائنات الصفحة (يتم إجراء البحث على حقل العنوان من كائن localizeInfos مع أخذ اللغة في الاعتبار)
مثال: "معلومات عنا"

url: string
رابط الصفحة
مثال: "catalog"

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

Examples

Minimal example

const response = await Pages.searchPage('cup');

Example with attributes

const response = await Pages.searchPage('cup', 'en_US');

Example response

[
{
"id": 10,
"parentId": null,
"pageUrl": "catalog",
"depth": 0,
"localizeInfos": {
"title": "كتالوج",
"menuTitle": "كتالوج",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"blocks": [
"product_block",
"test"
],
"type": "catalog_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": []
}
},
"moduleFormConfigs": [],
"isSync": true,
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "قالب",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
}
]

Response schema

Schema: 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