getPages
Получение всех объектов страниц с информацией о продуктах в виде массива.
Описание
Этот метод извлекает все созданные страницы в виде массива из API. Он возвращает Promise, который разрешается в массив объектов IPagesEntity.
Pages.getPages(
langCode);
Схема параметров
Схема
langCode: string
Код языка. По умолчанию: "en_US"
пример: "en_US"
Примеры
Минимальный пример
const response = await Pages.getPages();
Пример с атрибутами
const response = await Pages.getPages('en_US');
Пример ответа
[
{
"id": 9,
"config": {},
"depth": 1,
"parentId": 8,
"pageUrl": "blog1",
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Блог 1",
"menuTitle": "Блог 1",
"htmlContent": "",
"plainContent": ""
},
"position": 1,
"isVisible": true,
"products": 0,
"childrenCount": 0,
"type": "common_page",
"templateIdentifier": null,
"isSync": false,
"attributeValues": {}
},
{
"id": 8,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "blog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "Блог",
"menuTitle": "Блог",
"htmlContent": "",
"plainContent": ""
},
"position": 2,
"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": 3,
"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
Уникальный URL страницы.
пример: "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