getRootPages
Getting all top-level page objects (parentId = null)
Pages.getRootPages(langCode)
const value = await Pages.getRootPages()
Schema
langCode: string
lang code
example: en_US
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 or an empty array [] if there is no data.
Example return:
[
{
"id": 1,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "blog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"position": 1,
"isVisible": true,
"products": 0,
"childrenCount": 1,
"type": "forUsualPage",
"templateIdentifier": "template",
"isSync": true,
"attributeValues": {
"text": {
"type": "string",
"value": "some text",
"position": 0
}
}
}
]
Schema
id: number
object identifier
example: 1764
parentId number
parent page identifier, if null, it is a top-level page
example: null
config Record<string, number>
output settings for catalog pages
example:
{
"rowsPerPage": 1,
"productsPerRow": 1
}
pageUrl string
unique page URL
depth number
page nesting depth relative to parentId
example: 3
localizeInfos: Record<string, any>
json description of the main page data object taking into account the language "en_US" (for example)
example:
{
"en_US": {
"title": "Catalog",
"plainContent": "Content for catalog",
"htmlContent": "<b>Content for catalog</b>",
"menuTitle": "Catalog"
}
}
isVisible: boolean
Page visibility flag
example: true
products number
Number of products linked to the page
example: 0
attributeSetId: number
attribute set identifier
example: 7
forms
Array of FormEntity object identifier values linked to the page (optional)
blocks
Array of BlockEntity object identifier values linked to the page (optional)
isSync: boolean
indicator of page indexing (true or false)
example: false
templateIdentifier: string
Custom identifier of the linked template
example: my-template
attributeValues: Record<string, string>
Array of attribute values from the index (presented as a pair of custom attribute identifier: attribute value)
example:
{
"en_US": {
"marker": {
"value": "",
"type": "string"
}
}
}
position: number
position number for sorting (optional)
example: 192
type: string
Page type
example: forNewsPage
Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service ]
childrenCount: number
number of nested pages
example: 0