Skip to main content

getPageById

Getting a single page object with information about forms, blocks, menus attached to the page

Pages.getPageById(id, langCode)

const value = await Pages.getPageById(1);
Schema

id:*
Page object identifier
example: 1

langCode:
lang code
example: en_US

This method retrieves a single page object based on its identifier (id) from the API. It returns a Promise that resolves to the page object, with the specific object depending on the type of page being returned.

Example return:

{
"id": 1,
"parentId": null,
"pageUrl": "blog",
"depth": 0,
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"forms": [],
"blocks": [],
"type": "forUsualPage",
"templateIdentifier": "template",
"attributeValues": {
"text": {
"type": "string",
"value": "some text",
"position": 0
}
},
"isSync": true
}
Schema

id: number
object identifier
example: 1764

parentId number
parent page identifier, if null, it is a top-level page
example: null

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

position: number
position number (for sorting)
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 ]

templateIdentifier: string
custom identifier of the associated template
example: my-template

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

products number
number of products associated with the page
example: 0