getPages
Getting all page objects with product information as an array.
Description
This method retrieves all created pages as an array from the API. It returns a Promise that resolves to an array of IPagesEntity objects.
Pages.getPages(
langCode);
Parameters schema
Schema
langCode: string
Language code. Default: "en_US"
example: "en_US"
Examples
Minimal example
const response = await Pages.getPages();
Example with attributes
const response = await Pages.getPages('en_US');
Example response
[
{
"id": 10,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "catalog",
"attributeSetIdentifier": "page",
"total": "3",
"localizeInfos": {
"title": "Catalog",
"menuTitle": "Catalog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"products": 3,
"childrenCount": "0",
"type": "catalog_page",
"position": 5,
"templateIdentifier": "template",
"isSync": true,
"categoryPath": "catalog",
"attributeValues": {
"text": {
"type": "string",
"value": "catalog text",
"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": [],
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
},
{
"id": 8,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "blog",
"attributeSetIdentifier": "page",
"total": "3",
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"products": 0,
"childrenCount": "1",
"type": "common_page",
"position": 3,
"templateIdentifier": "template",
"isSync": true,
"categoryPath": "blog",
"attributeValues": {
"text": {
"type": "string",
"value": "some text",
"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": [
{
"id": 9,
"formIdentifier": "full_form",
"moduleIdentifier": "content",
"isGlobal": false,
"isClosed": false,
"isModerate": true,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "blog",
"isNested": false
}
],
"formDataCount": 3134,
"entityFormDataCount": {
"blog": 3134
},
"nestedEntityIdentifiers": []
},
{
"id": 3,
"formIdentifier": "file_form",
"moduleIdentifier": "content",
"isGlobal": false,
"isClosed": false,
"isModerate": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "blog",
"isNested": false
}
],
"formDataCount": 415,
"entityFormDataCount": {
"blog": 415
},
"nestedEntityIdentifiers": []
},
{
"id": 2,
"formIdentifier": "test-form",
"moduleIdentifier": "content",
"isGlobal": false,
"isClosed": false,
"isModerate": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "blog",
"isNested": false
}
],
"formDataCount": 606,
"entityFormDataCount": {
"blog": 606
},
"nestedEntityIdentifiers": []
}
],
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
},
{
"id": 9,
"config": {},
"depth": 1,
"parentId": 8,
"pageUrl": "blog1",
"attributeSetIdentifier": null,
"total": "3",
"localizeInfos": {
"title": "Blog 1",
"menuTitle": "Blog 1",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"products": 0,
"childrenCount": "0",
"type": "common_page",
"position": 1,
"templateIdentifier": null,
"isSync": false,
"categoryPath": "blog/blog1",
"attributeValues": {},
"moduleFormConfigs": []
}
]
Response schema
Schema: IPagesEntity[]
id: number
The identifier of the object.
example: 8
parentId: number | null
The id of the parent page, if it contains null, then it is the top-level page.
example: 10
pageUrl: string
Unique page Url.
example: "blog"
depth: number
Page nesting depth relative to parentId.
example: 10
localizeInfos: ILocalizeInfo
The name of the page, taking into account localization.
example:
{
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
}
isVisible: boolean
A sign of page visibility.
example: true
type: Types
Page type.
example: "common_page"
templateIdentifier: string | null
User id of the linked template.
example: "template"
attributeSetIdentifier: string | null
Set of attributes id.
example: "page"
attributeValues: AttributeType
Array of attribute values from the index (represented as a pair of user attribute id: attribute value).
example:
{
"text": {
"type": "string",
"value": "some text",
"position": 0,
"additionalFields": []
}
}
isSync: boolean
Indication of page indexing.
example: true
template: object
Template object.
example:
position: number
Item number (for sorting).
example: 2
config: Record<string, number>
Output settings for catalog pages.
example:
{
"rowsPerPage": 1,
"productsPerRow": 1
}
products: number
The number of products linked to the page.
example: 0
childrenCount: string
Children count.
example: 1
blocks: IBlockEntity[] | string[]
blocks.
example:
{
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
moduleFormConfigs: Array<IFormConfig>
Module form configurations linked to the page.
total: string
Total number of products linked to the page.
example: "10"
categoryPath: string
Category path string.
example: "catalog"