getBlockByMarker
Bir blok nesnesini işaretçisi ile alma
Blocks.getBlockByMarker(marker, langCode, offset, limit)
const value = await Blocks.getBlockByMarker('my-marker')
Şema
marker:* string
Blok işaretçisi
örnek: my-marker
langCode: string
Dil kodu
örnek: en_US
offset: number
Sayfalama için parametre. Varsayılan 0'dır
örnek: 0
limit: number
Sayfalama için parametre. Varsayılan 30'dur
örnek: 30
Bu yöntem, işaretçiye dayalı olarak tek bir blok nesnesi döndürür.
Örnek dönüş:
{
"id": 3,
"localizeInfos": {
"title": "Block"
},
"version": 0,
"position": 1,
"identifier": "block",
"type": "common_block",
"templateIdentifier": null,
"isVisible": true,
"attributeValues": {}
}
Şema
id: number
Nesnenin tanımlayıcısı
örnek: 1764
localizeInfos: CommonLocalizeInfos
Yerelleştirmeyi dikkate alarak blok adı
örnek:
{
"en_US": {
"title": "My block"
}
}
customSettings: BlockCustomSettings
Farklı blok türleri için bireysel ayarlar
BlockCustomSettings
örnek:
{
"sliderDelay": 0,
"sliderDelayType": "",
"productConfig": {
"quantity": 2,
"sortType": "By_ID",
"sortOrder": "DESC",
"countElementsPerRow": 10
},
"similarProductRules": [
{
"property": "Descending",
"includes": "",
"keywords": "",
"strict": ""
}
],
"condition": {
"name": "title"
}
}
version: number
Nesne değişikliğinin sürüm numarası
örnek: 10
identifier: string
Kayıt alanı için metinsel tanımlayıcı
örnek: catalog
varsayılan: marker
position: number
Sıralama için pozisyon numarası
örnek: 192
productPageUrls: any
URL sayfasının benzersiz parçalarının dizisi (son "/" sonrası) - ürünlerin temin edilebileceği kategoriler (isteğe bağlı)
örnek:
[ "23-laminat-floorwood-maxima" ]
isVisible: boolean
Blok görünürlük (mevcudiyet) göstergesi
örnek: true
attributeValues: Record<string, string>
İndeksten alınan özellik değerleri dizisi (tip, değer, özellik için ek alanlar dizisi)
örnek:
{
"en_US": {
"marker": {
"value": "",
"type": "string",
"position": 1,
"isProductPreview": false,
"isIcon": false,
"attributeFields": {
"marker": {
"type": "string",
"value": "test"
}
}
}
}
}
type: string
Blok türü
örnek: forNewsPage
Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service ]
attributeSetId: number
Kullanılan özellik setinin tanımlayıcısı
örnek: 7
position: number
Sıralama için pozisyon numarası
örnek: 192
templateIdentifier: string
Blok tarafından kullanılan şablon işaretçisi (null olabilir)
örnek: null