getPageByUrl
Getting a single page object with information about forms, blocks, menus attached to the page by URL
Pages.getPageByUrl(url, langCode)
const value = await Pages.getPageByUrl('shop');
Schema
url:* string
Page URL
example: shop
langCode: string
lang code
example: en_US
This method retrieves a single page object based on its URL (url) 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": 3,
"parentId": 1,
"pageUrl": "blog1",
"depth": 1,
"localizeInfos": {
"title": "Blog 1",
"menuTitle": "Blog 1",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"forms": [],
"blocks": [],
"type": "forUsualPage",
"templateIdentifier": null,
"attributeValues": {},
"isSync": false
}
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