Ana içeriğe geç

getPageById

Bir sayfaya bağlı formlar, bloklar, menüler hakkında bilgi içeren tek bir sayfa nesnesi almak.

Sayfalar?.getPageById( id?, langCode? );

Minimal örnek

const value = await Pages.getPageById(1);
Şema

id(gerekli): number
Alınacak sayfanın benzersiz tanımlayıcısı
örnek: 1

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

Bu yöntem, API'den tanımlayıcısına (id) dayalı olarak tek bir sayfa nesnesi alır. Sayfa nesnesine dönen Promise, dönen sayfanın türüne bağlı olarak belirli bir nesne döndürür.

Örnek yanıt

{
"id": 8,
"parentId": null,
"pageUrl": "blog",
"depth": 0,
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"forms": [],
"blocks": [],
"type": "common_page",
"templateIdentifier": "template",
"attributeSetIdentifier": "page",
"attributeValues": {
"text": {
"type": "string",
"value": "some text",
"position": 0,
"additionalFields": []
},
"number": {
"type": "integer",
"value": 0,
"position": 1,
"additionalFields": []
},
"real": {
"type": "real",
"value": "",
"position": 2,
"additionalFields": []
},
"float": {
"type": "float",
"value": 0,
"position": 3,
"additionalFields": []
}
},
"isSync": true,
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
}
Şema

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

parentId: number | null
Eğer null içeriyorsa, üst düzey sayfanın id'si.
örnek: 10

pageUrl: string
Benzersiz sayfa URL'si.
örnek: "blog"

depth: number
parentId'ye göre sayfa iç içe geçme derinliği.
örnek: 10

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

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

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

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

"common_page"

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

attributeSetIdentifier: string | null
Öznitelik seti id'si.
örnek: "page"

attributeValues: AttributeType
İndeksten öznitelik değerleri dizisi (kullanıcı öznitelik id'si: öznitelik değeri çifti olarak temsil edilir).
örnek:

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

isSync: boolean
Sayfa indeksleme belirtisi.
örnek: true

template: any
Şablon nesnesi.

position: number
Sıralama için öğe numarası.
örnek: 2

config: any
Katalog sayfaları için çıktı ayarları.
örnek:

{
"rowsPerPage": 1,
"productsPerRow": 1
}

products: number
Sayfaya bağlı ürün sayısı.
örnek: 0

childrenCount: number
Çocuk sayısı.
örnek: 1