getPageById
Getting a single page object with information about forms, blocks, menus attached to the page.
Pages?.getPageById( id?, langCode? );
Minimal example
const value = await Pages.getPageById(1);
Schema
id(required): number
The unique identifier of the page to be fetched
example: 1
langCode: string
Language code. Default: "en_US"
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 response
{
"id": 8,
"parentId": null,
"pageUrl": "blog",
"depth": 0,
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"forms": [],
"blocks": [],
"type": "common_page",
"templateIdentifier": "template",
"attributeSetIdentifier": "page",
"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": []
}
},
"isSync": true,
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
}
Schema
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: any
Template object.
position: number
Item number (for sorting).
example: 2
config: any
Output settings for catalog pages.
example:
{
"rowsPerPage": 1,
"productsPerRow": 1
}
products: number
The number of products linked to the page.
example: 0
childrenCount: number
Children count.
example: 1