searchBlock
Recherche rapide d'objets de bloc avec une sortie limitée. Cela renvoie une promesse qui se résout en un tableau d'objets ISearchBlock.
Description
Blocks.searchBlock(
name,
langCode
);
Parameters schema
Schéma
name(obligatoire): string
Chaîne de recherche
exemple : "product_block"
langCode: string
Code de langue. Par défaut : "en_US"
exemple : "en_US"
Examples
Exemple minimal
const response = await Blocks.searchBlock('my-marker');
Exemple avec des attributs
const response = await Blocks.searchBlock('my-marker', 'en_US');
Exemple de réponse
[
{
"id": 5,
"identifier": "another",
"name": "another"
},
{
"id": 2,
"identifier": "similar",
"name": "similar"
}
]
Schéma de réponse
Schéma : ISearchBlock[]
id: number
Identifiant unique du bloc de recherche.
exemple : 1
identifier: string
Identifiant de chaîne unique pour le bloc de recherche.
exemple : "search_block_1"
name: string
Nom du bloc de recherche.
exemple : "Search Block 1"