Ana içeriğe geç

getBlocks

Tüm blok nesnelerini alma

Blocks.getBlocks(type, langCode, offset, limit)

const value = await Blocks.getBlocks('forTextBlock')
Şema

type:* BlockType
Mevcut değerler: forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, forOrder, service
örnek: forTextBlock

langCode: string
Dil kodu
örnek: en_US

offset: number
Sayfalama için parametre. Varsayılan 0
örnek: 0

limit: number
Sayfalama için parametre. Varsayılan 30
örnek: 30

Bu yöntem, tüm blok nesnelerinin ve toplamın bir dizisini döndürür.

Örnek dönüş:

{
"total": 100,
"items": [
{
"id": 1,
"localizeInfos": {
"title": "Block"
},
"version": 0,
"position": 1,
"identifier": "block",
"type": "forTextBlock",
"templateIdentifier": null,
"isVisible": true,
"attributeValues": {}
}
]
}
Şema

total: number
Bulunan kayıtların toplam sayısı
örnek: 100

id: number
Nesne tanımlayıcısı
örnek: 1764

attributeSetId: number
Kullanılan özellik seti için tanımlayıcı
örnek: 7

localizeInfos: CommonLocalizeInfos
yerelleştirilmiş blok adı
örnek:

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

customSettings: BlockCustomSettings
farklı blok türleri için özel ayarlar
örnek:

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

version: number
Nesne sürüm numarası
örnek: 10

identifier: string
alan kaydı için metinsel tanımlayıcı
örnek: catalog
varsayılan: marker

position: number
sıralama için pozisyon numarası
örnek: 192

attributeValues: Record<string, string>
indeksten gelen özellik değerlerinin dizisi (özel özellik tanımlayıcısı: özellik değeri çifti olarak sunulur)
örnek:

{
"en_US": {
"marker": {
"value": "",
"type": "string"
}
}
}

type: string
blok türü
örnek: forNewsPage

templateIdentifier: string
blok tarafından kullanılan şablon işareti (null olabilir)
Enum: [ forCatalogProducts, forBasketPage, forErrorPage, forCatalogPages, forProductPreview, forProductPage, forSimilarProductBlock, forStatisticProductBlock, forProductBlock, forForm, forFormField, forNewsPage, forNewsBlock, forNewsPreview, forOneNewsPage, forUsualPage, forTextBlock, forSlider, service ]
örnek: null