Lewati ke konten utama

getTemplateByMarker

Mengambil satu objek template berdasarkan marker.

Deskripsi

Metode ini mengambil satu objek template berdasarkan pengidentifikasi (marker) dari API. Ini mengembalikan sebuah Promise yang menyelesaikan menjadi objek template ITemplateEntity.

Templates.getTemplateByMarker(

marker*, langCode

);

Skema parameter

Skema

marker(diperlukan): string
Marker unik dari template yang akan diambil
contoh: "template_12345"

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

Contoh

Contoh minimal

const response = await Templates.getTemplateByMarker('my-marker');

Contoh dengan atribut langCode

const response = await Templates.getTemplateByMarker('my-marker', 'en_US');

Contoh respons

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

Skema respons

Skema: ITemplateEntity

id: number
Pengidentifikasi unik dari posisi.
contoh: 12345

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

title: string
Nama dari template.
contoh: "Template Produk"

generalTypeId: number
Id Entitas tipe umum.
contoh: 67890

identifier: string
Pengidentifikasi tekstual untuk field record.
contoh: "template_12345"

version: number
Nomor versi dari objek.
contoh: 1

generalTypeName: BlockType
Nama tipe umum.
contoh: "produk"

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

{
"id": 1,
"value": "some"
}

position: number
Posisi dari objek.
contoh: 1