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. Bir Promise döner ve bu Promise, üst düzey sayfa nesnelerinin bir dizisine IPagesEntity veya veri yoksa boş bir dizi [] ile çözülür.

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": 10,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "catalog",
"attributeSetIdentifier": "page",
"total": "2",
"localizeInfos": {
"title": "Catalog",
"menuTitle": "Catalog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"products": 3,
"childrenCount": "0",
"type": "catalog_page",
"position": 5,
"templateIdentifier": "template",
"isSync": true,
"categoryPath": "catalog",
"rating": {},
"attributeValues": {
"text": {
"type": "string",
"value": "catalog 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": {}
}
},
"moduleFormConfigs": [],
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}
},
{
"id": 8,
"config": {},
"depth": 0,
"parentId": null,
"pageUrl": "blog",
"attributeSetIdentifier": "page",
"total": "2",
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog",
"htmlContent": "",
"plainContent": ""
},
"isVisible": true,
"products": 0,
"childrenCount": "1",
"type": "common_page",
"position": 3,
"templateIdentifier": "template",
"isSync": true,
"categoryPath": "blog",
"rating": {},
"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": {}
}
},
"moduleFormConfigs": [
{
"id": 9,
"formIdentifier": "full_form",
"moduleIdentifier": "content",
"isGlobal": false,
"isClosed": false,
"isModerate": true,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "blog",
"isNested": false
}
],
"formDataCount": 3902,
"ratingCalculation": "average",
"allowHalfRatings": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"blog": 3902
},
"nestedEntityIdentifiers": [],
"exceptionIds": []
},
{
"id": 3,
"formIdentifier": "file_form",
"moduleIdentifier": "content",
"isGlobal": false,
"isClosed": false,
"isModerate": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "blog",
"isNested": false
}
],
"formDataCount": 479,
"ratingCalculation": "average",
"allowHalfRatings": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"blog": 479
},
"nestedEntityIdentifiers": [],
"exceptionIds": []
},
{
"id": 2,
"formIdentifier": "test-form",
"moduleIdentifier": "content",
"isGlobal": false,
"isClosed": false,
"isModerate": false,
"viewOnlyMyData": false,
"commentOnlyMyData": false,
"entityIdentifiers": [
{
"id": "blog",
"isNested": false
}
],
"formDataCount": 688,
"ratingCalculation": "average",
"allowHalfRatings": null,
"maxRatingScale": null,
"isAnonymous": null,
"allowRerating": null,
"isRating": null,
"entityFormDataCount": {
"blog": 688
},
"nestedEntityIdentifiers": [],
"exceptionIds": []
}
],
"template": {
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"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 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
Sayfanın görünürlük durumu.
ö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: IAttributeValues
Anahtarları işaretleyici olan öznitelik değerleri haritası; yoksa boş nesne.
örnek:

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

isSync: boolean
Sayfa dizinleme durumu.
örnek: true

template: object
Şablon nesnesi.
örnek:

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

config: Record<string, number>
Katalog sayfaları için çıktı ayarları.
örnek:

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

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

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

blocks: IBlockEntity[] | string[]
bloklar.
örnek:

{
"id": 4,
"attributeSetIdentifier": null,
"title": "Template",
"generalTypeId": 4,
"identifier": "template",
"version": 0,
"generalTypeName": "catalog_page",
"attributeValues": {},
"position": 1
}

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

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

blocks.id: number
Blokun benzersiz tanımlayıcısı.
örnek: 1234

blocks.localizeInfos: ILocalizeInfo
Blok için yerelleştirme bilgisi.
örnek:

{
"key": "value"
}

blocks.version: number
Blok varlığının versiyonu.
örnek: 1

blocks.identifier: string
Blok için benzersiz dize tanımlayıcısı.
örnek: "block1"

blocks.type: BlockType
Blok türü.
örnek: "product"

blocks.position: number
Sıralama için blokun pozisyonu.
örnek: 1

blocks.templateIdentifier: string | null
Blok tarafından kullanılan şablonun tanımlayıcısı veya geçerli değilse null.
örnek: "template1"

blocks.isVisible: boolean
Blokun görünür olup olmadığını gösterir.
örnek: true

blocks.countElementsPerRow: number
Blokta her satırda görüntülenen öğe sayısı, geçerliyse.
örnek: 3

blocks.quantity: number
Blokta bulunan öğe sayısı, geçerliyse.
örnek: 5

blocks.similarProducts: IProductsResponse
Blok ile ilişkili benzer ürünleri içeren yanıt.
örnek:

{
"total": 10,
"items": []
}

similarProducts.total: number
Bulunan toplam ürün sayısı.
örnek: 100

similarProducts.items: IProductsEntity[]
Ürün varlıklarının dizisi.
örnek:

[
{
"id": 12345,
"title": "Product 1"
},
{
"id": 67890,
"title": "Product 2"
}
]

items.id: number
Benzersiz tanımlayıcı.
örnek: 12345

items.localizeInfos: ILocalizeInfo
Ürünlerin adı, yerelleştirmeyi dikkate alarak.
örnek:

items.statusIdentifier: string | null
Ürün sayfası durum tanımlayıcıları (null olabilir).
örnek: "in_stock"

items.statusLocalizeInfos: ILocalizeInfo
Ürün için yerelleştirilmiş durum adı.
örnek: { "title": "İndirim" }

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

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

items.price: number | null
Dizinden alınan ürün sayfası fiyatının değeri.
örnek: 150.00

items.additional: object
Dizinden alınan ek değer.
örnek: { prices: { min: 5 max: 150 } }

items.sku: string | null
Ürün SKU'su (Stok Tutma Birimi), null olabilir.
örnek: "SKU_12345"

items.isSync: boolean
Sayfa dizinleme durumu.
örnek: true

items.attributeValues: AttributeType
Dizinden alınan öznitelik değerleri dizisi, temsil edilen.
örnek:

[
{
"id": "color",
"value": "red"
}
]

items.categories: string[]
Ürün kategorileri.
örnek:

[
1,
2,
3
]

items.isVisible: boolean
Sayfanın görünürlük durumu.
örnek: true

items.moduleFormConfigs: Array<IFormConfig>
Modül form yapılandırmaları (isteğe bağlı).

items.rating: IRating
Değerlendirme verileri.

items.isPositionLocked: boolean
Sıralama pozisyonu kilit durumu göstergesi (isteğe bağlı).
örnek: false

items.relatedIds: number[]
İlgili ürün sayfalarının id'leri.
örnek:

[
12345,
67890
]

items.paymentStages: unknown
Ödeme aşamaları verileri (null olabilir).
örnek: null

items.discountConfig: Record<string, unknown>
İndirim yapılandırma nesnesi.
örnek:

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

items.shortDescTemplateIdentifier: string | null
Kısa açıklama için bağlı şablonun kullanıcı id'si.
örnek: "short_desc_template_12345"

items.signedPrice: string
Fiyat işareti.

items.productPages: IProductPageRef[]
Ürünü sayfalarına bağlayan ürün sayfası referanslarının dizisi.
örnek:

[
{
"id": 16,
"pageId": 4,
"productId": 15,
"positionId": 244,
"categoryPath": "products"
}
]

productPages.id: number
Ürün-sayfa bağlantı kaydının benzersiz tanımlayıcısı.
örnek: 16

productPages.pageId: number
Ürünün bağlı olduğu sayfanın tanımlayıcısı.
örnek: 4

productPages.productId: number
Ürünün tanımlayıcısı.
örnek: 15

productPages.positionId: number
Sayfa içindeki sıralama pozisyonu tanımlayıcısı.
örnek: 244

productPages.categoryPath: string
Ürünün ait olduğu sayfanın kategori yolu.
örnek: "products"

items.blocks: string[]
Blok tanımlayıcılarının dizisi.
örnek:

[
"block_12345",
"block_67890"
]

blocks.products: IProductsEntity[]
Blok ile ilişkili ürün varlıklarının dizisi.
örnek:

[
{
"id": 1,
"name": "Product 1"
},
{
"id": 2,
"name": "Product 2"
}
]

moduleFormConfigs: Array<IFormConfig>
Sayfaya bağlı modül form yapılandırmaları.

rating: IRating
Değerlendirme verileri.

total: string
Sayfaya bağlı toplam ürün sayısı.
örnek: "10"

categoryPath: string
Kategori yolu dizesi.
örnek: "catalog"