Skip to main content

getRootPages

Getting all top-level page objects (parentId = null).

Description

This method retrieves all top-level page objects from the API. It returns a Promise that resolves to an array of top-level page objects IPagesEntity or an empty array [] if there is no data.

Pages.getRootPages(langCode);

Parameters schema

Schema

langCode: string
Language code. Default: "en_US"
example: "en_US"

Examples

Minimal example

const response = await Pages.getRootPages();

Example response

[
{
"id": 10,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "catalog",
"attributeSetIdentifier": "page",
"total": "2",
"localizeInfos": {
"title": "Catalog",
"menuTitle": "Catalog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"products": 3,
"childrenCount": "0",
"type": "catalog_page",
"position": 5,
"templateIdentifier": "template",
"isSync": true,
"categoryPath": "catalog",
"rating": {},
"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": "2",
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"products": 0,
"childrenCount": "1",
"type": "common_page",
"position": 3,
"templateIdentifier": "template",
"isSync": true,
"categoryPath": "blog",
"rating": {},
"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": 3578,
"ratingCalculation": "average",
"allowHalfRatings": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"blog": 3578
},
"nestedEntityIdentifiers": [],
"exceptionIds": []
},
{
"id": 3,
"formIdentifier": "file_form",
"moduleIdentifier": "content",
"isGlobal": false,
"isClosed": false,
"isModerate": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "blog",
"isNested": false
}
],
"formDataCount": 452,
"ratingCalculation": "average",
"allowHalfRatings": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"blog": 452
},
"nestedEntityIdentifiers": [],
"exceptionIds": []
},
{
"id": 2,
"formIdentifier": "test-form",
"moduleIdentifier": "content",
"isGlobal": false,
"isClosed": false,
"isModerate": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "blog",
"isNested": false
}
],
"formDataCount": 659,
"ratingCalculation": "average",
"allowHalfRatings": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"blog": 659
},
"nestedEntityIdentifiers": [],
"exceptionIds": []
}
],
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
}
]

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
}

blocks.attributeValues: AttributeType
Type of attributes used in the block.
example:

{
"block-text": {
"type": "string",
"value": "some text",
"isIcon": false,
"position": 0,
"additionalFields": [],
"isProductPreview": false
}
}

blocks.id: number
Unique identifier of the block.
example: 1234

blocks.localizeInfos: ILocalizeInfo
Localization information for the block.
example:

{
"key": "value"
}

blocks.version: number
Version of the block entity.
example: 1

blocks.identifier: string
Unique string identifier for the block.
example: "block1"

blocks.type: string
Type of the block, such as 'product', 'error_page', etc.
example: "product"

blocks.position: number
Position of the block for sorting.
example: 1

blocks.templateIdentifier: string | null
Identifier for the template used by the block, or null if not applicable.
example: "template1"

blocks.isVisible: boolean
Indicates whether the block is visible.
example: true

blocks.countElementsPerRow: number
Number of elements displayed per row in the block, if applicable.
example: 3

blocks.quantity: number
Quantity of items in the block, if applicable.
example: 5

blocks.similarProducts: IProductsResponse
Response containing similar products associated with the block.
example:

{
"total": 10,
"items": []
}

similarProducts.total: number
The total number of products found.
example: 100

similarProducts.items: IProductsEntity[]
An array of product entities.
example:

[
{
"id": 12345,
"title": "Product 1"
},
{
"id": 67890,
"title": "Product 2"
}
]

items.id: number
The unique identifier.
example: 12345

items.localizeInfos: ILocalizeInfo
The name of the products, taking into account localization.
example:

items.statusIdentifier: string | null
Product page status identifiers (may be null).
example: "in_stock"

items.statusLocalizeInfos: Record<string, unknown>
JSON description of the item status object, taking into account the language.
example:

items.attributeSetIdentifier: string | null
Set of attributes id.
example: "set_12345"

items.position: number
Item number (for sorting).
example: 1

items.price: number | null
The value of the product page price taken from the index.
example: 150.00

items.additional: object
Additional value from the index.
example:

{
"en": "In Stock",
"de": "Auf Lager"
}

items.sku: string | null
Product SKU (Stock Keeping Unit), may be null.
example: "SKU_12345"

items.isSync: boolean
Indication of page indexing.
example: true

items.attributeValues: AttributeType
Array of attribute values from the index, represented.
example:

[
{
"id": "color",
"value": "red"
}
]

items.categories: string[]
Product categories.
example:

[
1,
2,
3
]

items.isVisible: boolean
A sign of page visibility.
example: true

items.moduleFormConfigs: Array<IFormConfig>
Module form configurations (optional).

items.rating: Record<string, unknown>
Rating data.

items.isPositionLocked: boolean
Sorting position lock indicator (optional).
example: false

items.relatedIds: number[]
Ids of related product pages.
example:

[
12345,
67890
]

items.paymentStages: unknown
Payment stages data (may be null).
example: null

items.discountConfig: Record<string, unknown>
Discount configuration object.
example:

items.templateIdentifier: string | null
User id of the linked template.
example: "template_12345"

items.shortDescTemplateIdentifier: string | null
User id of the linked template for a short description.
example: "short_desc_template_12345"

items.signedPrice: string
Price sign.

items.productPages: Array<Record<string, unknown>> | Record<string, unknown>
Array of product pages or a single product page object.
example: []

items.blocks: string[]
Array of block identifiers.
example:

[
"block_12345",
"block_67890"
]

blocks.products: IProductsEntity[]
Array of product entities associated with the block.
example:

[
{
"id": 1,
"name": "Product 1"
},
{
"id": 2,
"name": "Product 2"
}
]

moduleFormConfigs: Array<IFormConfig>
Module form configurations linked to the page.

rating: Record<string, unknown>
Rating data.

total: string
Total number of products linked to the page.
example: "10"

categoryPath: string
Category path string.
example: "catalog"