Ana içeriğe geç

getRootPages

Tüm üst düzey sayfa nesnelerini almak (parentId = null).

Açıklama

Bu yöntem, API'den tüm üst düzey sayfa nesnelerini alır. Üst düzey sayfa nesnelerinin bir dizisine veya veri yoksa boş bir dizi [] döndüren bir Promise döner.

Sayfalar.getRootPages(langCode);

Parametreler şeması

Şema

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

Örnekler

Minimal örnek

const response = await Pages.getRootPages();

Örnek yanıt

[
{
"id": 8,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "blog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"position": 1,
"isVisible": true,
"products": 0,
"childrenCount": 1,
"type": "common_page",
"templateIdentifier": "template",
"isSync": true,
"attributeValues": {
"text": {
"type": "string",
"value": "bazı metin",
"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": []
}
},
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Şablon",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
},
{
"id": 10,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "catalog",
"attributeSetIdentifier": "page",
"localizeInfos": {
"title": "Katalog",
"menuTitle": "Katalog",
"htmlContent": "",
"plainContent": ""
},
"position": 2,
"isVisible": true,
"products": 3,
"childrenCount": 0,
"type": "catalog_page",
"templateIdentifier": "template",
"isSync": true,
"attributeValues": {
"text": {
"type": "string",
"value": "katalog metni",
"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": []
}
},
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Şablon",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
}
]

Yanıt şeması

Şema: IPagesEntity[]

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

parentId: number | null
Eğer null içeriyorsa, üst sayfanın id'si, o zaman üst düzey sayfadır.
ö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üğü işareti.
ö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
İndeksin öznitelik değerleri dizisi (kullanıcı öznitelik id'si: öznitelik değeri çifti olarak temsil edilir).
örnek:

{
"text": {
"type": "string",
"value": "bazı metin",
"position": 0,
"additionalFields": []
}
}

isSync: boolean
Sayfa dizinleme belirtimi.
örnek: true

template: any
Şablon nesnesi.

position: number
Öğe numarası (sıralama için).
ö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