Lewati ke konten utama

getChildPagesByParentUrl

Mengambil halaman anak dengan informasi produk berdasarkan URL halaman induk sebagai array.

Deskripsi

Mengembalikan semua halaman yang dibuat sebagai array objek atau array kosong [] (jika tidak ada data) untuk induk yang dipilih. Ini mengembalikan Promise yang menyelesaikan menjadi array objek IPagesEntity.

Halaman.getChildPagesByParentUrl(

url*, langCode

);

Skema parameter

Skema

url(wajib): string
URL halaman induk yang akan diambil halaman anaknya
contoh: "about/our-team"

langCode: string
Kode bahasa. Default: "en_US"
contoh: "en_US"

Contoh

Contoh minimal

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

Contoh dengan atribut

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

Contoh respons

[
{
"id": 9,
"config": {},
"depth": 1,
"parentId": 8,
"pageUrl": "blog1",
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Blog 1",
"htmlContent": "",
"plainContent": "",
"menuTitle": "Blog 1"
},
"isVisible": true,
"products": 0,
"childrenCount": 0,
"type": "common_page",
"position": 1,
"templateIdentifier": null,
"isSync": false,
"categoryPath": "blog/blog1",
"rating": {},
"attributeValues": {},
"moduleFormConfigs": []
},
{
"id": 49,
"config": {},
"depth": 1,
"parentId": 8,
"pageUrl": "blog2",
"attributeSetIdentifier": null,
"localizeInfos": {
"title": "Blog 2",
"htmlContent": "",
"plainContent": "",
"menuTitle": "Blog 2"
},
"isVisible": true,
"products": 0,
"childrenCount": 0,
"type": "common_page",
"position": 2,
"templateIdentifier": null,
"isSync": false,
"categoryPath": "blog2",
"rating": {},
"attributeValues": {},
"moduleFormConfigs": []
}
]

Skema respons

Skema: IPagesEntity

id: number
Pengidentifikasi objek.
contoh: 8

parentId: number | null
Id halaman induk, jika mengandung null, maka itu adalah halaman tingkat atas.
contoh: 10

pageUrl: string
URL halaman yang unik.
contoh: "blog"

depth: number
Kedalaman nesting halaman relatif terhadap parentId.
contoh: 10

localizeInfos: ILocalizeInfo
Nama halaman, dengan mempertimbangkan lokalisasi.
contoh:

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

isVisible: boolean
Tanda visibilitas halaman.
contoh: true

type: PageType
Tipe halaman.
contoh: "common_page"

templateIdentifier: string | null
Id pengguna dari template yang terhubung.
contoh: "template"

attributeSetIdentifier: string | null
Set id atribut.
contoh: "page"

attributeValues: IAttributeValues
Peta nilai atribut yang dikunci oleh penanda; objek kosong jika tidak ada.
contoh:

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

isSync: boolean
Indikasi pengindeksan halaman.
contoh: true

template: object
Objek template.
contoh:

{}

position: number
Nomor item (untuk pengurutan).
contoh: 2

config: Record<string, number>
Pengaturan output untuk halaman katalog.
contoh:

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

products: number
Jumlah produk yang terhubung ke halaman.
contoh: 0

childrenCount: number
Jumlah anak.
contoh: 1

blocks: IBlockEntity[] | string[]
blok.
contoh:

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

blocks.attributeValues: IAttributeValues
Peta nilai atribut yang dikunci oleh penanda; objek kosong jika tidak ada.
contoh:

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

blocks.id: number
Pengidentifikasi unik dari blok.
contoh: 1234

blocks.localizeInfos: ILocalizeInfo
Informasi lokalisasi untuk blok.
contoh:

{
"key": "value"
}

blocks.version: number
Versi entitas blok.
contoh: 1

blocks.identifier: string
Pengidentifikasi string unik untuk blok.
contoh: "block1"

blocks.type: BlockType
Tipe blok.
contoh: "product"

blocks.position: number
Posisi blok untuk pengurutan.
contoh: 1

blocks.templateIdentifier: string | null
Pengidentifikasi untuk template yang digunakan oleh blok, atau null jika tidak berlaku.
contoh: "template1"

blocks.isVisible: boolean
Menunjukkan apakah blok terlihat.
contoh: true

blocks.countElementsPerRow: number
Jumlah elemen yang ditampilkan per baris di blok, jika berlaku.
contoh: 3

blocks.quantity: number
Jumlah item dalam blok, jika berlaku.
contoh: 5

blocks.similarProducts: IProductsResponse
Respons yang berisi produk serupa yang terkait dengan blok.
contoh:

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

blocks.products: IProductsEntity[]
Array entitas produk yang terkait dengan blok.
contoh:

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

moduleFormConfigs: Array<IFormConfig>
Konfigurasi formulir modul yang terhubung ke halaman.

rating: IRating
Data penilaian.

total: string
Total jumlah produk yang terhubung ke halaman.
contoh: "10"

categoryPath: string | null
String jalur kategori; null untuk halaman bersarang yang tidak memiliki jalur kategori sendiri.
contoh: "catalog"