Skip to main content

getBlocksByPageUrl

Receiving objects for a related block by URL

Pages.getBlocksByPageUrl(url, langCode)

const value = await Pages.getFormsByPageUrl('shop');
Schema

url:* string
Page URL
example: shop

langCode: string
lang code
example: en_US

Get PositionBlock objects for a related form by url. Returns an array of PositionBlock objects.

Example return:

[
{
"id": 2,
"localizeInfos": {
"title": "test"
},
"attributeSetIdentifier": "block",
"version": 0,
"position": 2,
"identifier": "test_identifier",
"type": "forTextBlock",
"templateIdentifier": null,
"isVisible": true,
"isSync": false,
"attributeValues": {},
"countElementsPerRow": 0
}
]
Schema

id: number
object identifier
example: 1764

version number
object version number
example: 10

identifier: string
text identifier for the record field
example: catalog

attributeSetId: number
attribute set identifier
example: 7

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"
}
}

customSettings: BlockCustomSettings
custom settings for different types of blocks
example:

{
"sliderDelay": 0,
"sliderDelayType": "",
"productQuantity": 4,
"productSortType": "By_ID",
"productSortOrder": "Descending",
"productCountElementsPerRow": 10,
"similarProductRules": [
{
"property": "Descending",
"includes": "",
"keywords": "",
"strict": ""
}
]
}

isSync: boolean
indicator of page indexing (true or false)
example: false

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 ]

templateIdentifier: string
marker of the template used by the block (can be null)
example: null