Skip to main content

getBlockByMarker

Getting a single block object by marker

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

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

marker:* string
Marker of Block
example: my-marker

langCode: string
Language code
example: en_US

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

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

This method return one blocks object by marker.

Example return:

{
"id": 1764,
"localizeInfos": {
"en_US": {
"title": "My block"
}
},
"customSettings": {
"sliderDelay": 0,
"sliderDelayType": "",
"productConfig": {
"quantity": 2,
"sortType": "By_ID",
"sortOrder": "DESC",
"countElementsPerRow": 10
},
"similarProductRules": [
{
"property": "Descending",
"includes": "",
"keywords": "",
"strict": ""
}
],
"condition": {
"name": "title"
}
},
"version": 10,
"identifier": "catalog",
"position": 192,
"productPageUrls": [
"23-laminat-floorwood-maxima"
],
"isVisible": true,
"attributeValues": {
"en_US": {
"marker": {
"value": "",
"type": "string",
"position": 1,
"isProductPreview": false,
"isIcon": false,
"attributeFields": {
"marker": {
"type": "string",
"value": "test"
}
}
}
}
},
"type": "forNewsPage",
"templateIdentifier": null,
"attributeSetIdentifier": "my-attributes-sets"
}
Schema

id: number
object identifier
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 where products can be taken (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
block type
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