Ana içeriğe geç

getBlocksByPageUrl

Sayfa URL'sine göre ilişkili bir blok için nesneleri alma.

Açıklama

URL ile sayfa için PositionBlock nesnelerini alın. Bir dizi IPositionBlock nesnesine çözülmekte olan bir Promise döndürür.

Sayfalar.getBlocksByPageUrl(

url*, langCode

);

Parametreler şeması

Şema

url(gerekli): string
Sayfa URL'si
örnek: "about"

langCode: string
Dil kodu. Varsayılan: "en_US"
örnek: "en_US"

Örnekler

Minimal örnek

const response = await Pages.getBlocksByPageUrl('shop');

Özelliklerle örnek

const response = await Pages.getBlocksByPageUrl('shop', 'en_US');

Örnek yanıt

[
{
"id": 1,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Product Block"
},
"isVisible": true,
"version": 0,
"position": 1,
"identifier": "product_block",
"type": "product_block",
"templateIdentifier": null,
"isSync": false,
"attributeValues": {}
},
{
"id": 4,
"attributeSetIdentifier": "block",
"localizeInfos": {
"title": "test"
},
"isVisible": true,
"version": 31,
"position": 2,
"identifier": "test",
"type": "common_block",
"templateIdentifier": null,
"isSync": true,
"attributeValues": {
"block-text": {
"type": "string",
"value": "some text",
"position": 0,
"additionalFields": {}
},
"interval": {
"type": "timeInterval",
"value": [
{
"values": [
{
"id": "bbc82c9f-1bc4-4c86-b83c-c062016eb7cb",
"dates": [
"2025-04-14T00:00:00.000Z",
"2025-04-14T00:00:00.000Z"
],
"times": [
[
{
"hours": 9,
"minutes": 0
},
{
"hours": 10,
"minutes": 0
}
],
[
{
"hours": 10,
"minutes": 0
},
{
"hours": 11,
"minutes": 0
}
],
[
{
"hours": 11,
"minutes": 0
},
{
"hours": 12,
"minutes": 0
}
],
"..."
],
"intervals": [],
"exceptions": [],
"intervalId": "c6466cd8-c55d-4583-97c5-42b684210f12",
"inEveryWeek": true,
"inEveryMonth": true,
"timeIntervals": [
[
"2025-04-07T09:00:00.000Z",
"2025-04-07T10:00:00.000Z"
],
[
"2025-04-07T10:00:00.000Z",
"2025-04-07T11:00:00.000Z"
],
[
"2025-04-07T11:00:00.000Z",
"2025-04-07T12:00:00.000Z"
],
"..."
]
}
],
"intervalId": "c6466cd8-c55d-4583-97c5-42b684210f12"
}
],
"position": 1,
"additionalFields": {}
}
}
},
{
"id": 6,
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Frequently ordered"
},
"isVisible": true,
"version": 1,
"position": 3,
"identifier": "freq_ordered",
"type": "frequently_ordered_block",
"templateIdentifier": null,
"isSync": false,
"attributeValues": {}
}
]

Yanıt şeması

Şema: IPositionBlock[]

id: number
Nesnenin tanımlayıcısı.
örnek: 1

attributeSetIdentifier: string | null
Özellikler kümesi id'si.
örnek: "block"

localizeInfos: ILocalizeInfo
Yerelleştirmeyi dikkate alarak sayfanın adı.
örnek:

{
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
}

version: number
Nesnenin sürüm numarası.
örnek: 0

position: number
Nesnenin pozisyonu.
örnek: 1

identifier: string
Kayıt alanı için metinsel tanımlayıcı.
örnek: "product_block"

type: Types
Sayfa türü.
örnek: "product"

templateIdentifier: string | null
Bağlı şablonun kullanıcı id'si.
örnek: null

isVisible: boolean
Sayfa görünürlüğü belirtisi.
örnek: true

isSync: boolean
Sayfa indeksleme belirtimi.
örnek: false

attributeValues: IAttributeValues
Anahtarları işaretleyici olan özellik değerleri haritası; yoksa boş nesne.
örnek:

{
"block-text": {
"type": "string",
"value": "some text",
"position": 0,
"additionalFields": []
}
}

countElementsPerRow: number
Blokta her satırda görüntülenen eleman sayısı, varsa.
örnek: 3

quantity: number
Bloktaki sayfa sayısı.
örnek: 1