getFilterByMarker
Dapatkan filter berdasarkan penandanya (pohon item).
Deskripsi
Metode ini mengambil satu filter konten berdasarkan penandanya, dilokalisasi ke bahasa yang diminta. Ini mengembalikan sebuah Promise yang menyelesaikan menjadi objek IContentFilter yang berisi informasi terlokalisasi dari filter dan pohon itemnya.
Filters.getFilterByMarker(
marker*,
langCode
);
Skema parameter
Skema
marker(diperlukan): string
Penanda filter
contoh: "main"
langCode: string
Kode bahasa. Default: "en_US"
contoh: "en_US"
Contoh
Contoh minimal
const response = await Filters.getFilterByMarker('main');
Contoh dengan atribut
const response = await Filters.getFilterByMarker('main', 'en_US');
Contoh respons
{
"localizeInfos": {
"title": "Filter"
},
"items": [
{
"type": "page",
"marker": null,
"url": "blog",
"localizeInfos": {
"title": "Blog",
"menuTitle": "Blog"
},
"value": null,
"position": 1,
"children": []
},
{
"type": "page",
"marker": null,
"url": "blog1",
"localizeInfos": {
"title": "Blog 1",
"menuTitle": "Blog 1"
},
"value": null,
"position": 2,
"children": []
},
{
"type": "page",
"marker": null,
"url": "catalog",
"localizeInfos": {
"title": "Catalog",
"menuTitle": "Catalog"
},
"value": null,
"position": 3,
"children": []
},
"..."
]
}
Skema respons
Skema: IContentFilter
localizeInfos: ILocalizeInfo
Informasi terlokalisasi dari filter dalam lokal yang diminta.
items: IContentFilterItem[]
Pohon item filter (item reguler + item kustom dalam satu array).
items.type: TContentFilterItemType
Tipe node pohon.
contoh: "page"
items.marker: string | null
Penanda entitas yang terhubung, atau null untuk tipe=page.
contoh: "about"
items.url: string | null
URL halaman (hanya untuk tipe=page; null sebaliknya).
contoh: "about"
items.localizeInfos: ILocalizeInfo
Informasi terlokalisasi dari entitas yang terhubung dalam lokal yang diminta.
items.value: string | null
Nilai node yang disatukan (misalnya, nilai diskon, judul atribut); null sebaliknya.
contoh: "10"
items.position: number
Posisi numerik (per level).
contoh: 1
items.children: IContentFilterItem[]
Node pohon bersarang (item reguler dan kustom dalam satu array).