Skip to main content

getBlockByMarker

Retrieving a single block object by its marker

Blocks.getBlockByMarker(marker, langCode, offset, limit)

const value = await Blocks.getBlockByMarker('my-marker')
Schema

marker:* string
The marker of the block
example: my-marker

langCode: string
Language code
example: en_US

offset: number
Parameter for pagination. Default is 0
example: 0

limit: number
Parameter for pagination. Default is 30
example: 30

This method returns a single block object based on the marker.

Example return:

{
"id": 3,
"localizeInfos": {
"title": "Block"
},
"version": 0,
"position": 1,
"identifier": "block",
"type": "common_block",
"templateIdentifier": null,
"isVisible": true,
"attributeValues": {}
}
Schema

id: number
Identifier of the object
example: 1764

localizeInfos: CommonLocalizeInfos
Block name considering localization
example:

{
"en_US": {
"title": "My block"
}
}

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

{
"sliderDelay": 0,
"sliderDelayType": "",
"productConfig": {
"quantity": 2,
"sortType": "By_ID",
"sortOrder": "DESC",
"countElementsPerRow": 10
},
"similarProductRules": [
{
"property": "Descending",
"includes": "",
"keywords": "",
"strict": ""
}
],
"condition": {
"name": "title"
}
}

version: number
Version number of the object change
example: 10

identifier: string
Textual identifier for the recording field
example: catalog
default: marker

position: number
Position number (for sorting)
example: 192

productPageUrls: any
Array of unique parts of the URL page (after the last "/") - categories from which products can be sourced (optional)
example:

[ "23-laminat-floorwood-maxima" ]

isVisible: boolean
Visibility (availability) indicator of the block
example: true

attributeValues: Record<string, string>
Array of attribute values from the index (type, value, array of additional fields for the attribute)
example:

{
"en_US": {
"marker": {
"value": "",
"type": "string",
"position": 1,
"isProductPreview": false,
"isIcon": false,
"attributeFields": {
"marker": {
"type": "string",
"value": "test"
}
}
}
}
}

type: string
Type of the block
example: forNewsPage
Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service ]

attributeSetId: number
Identifier for the used attribute set
example: 7

position: number
Position number (for sorting)
example: 192

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