Skip to main content

searchBlock

Quick search for block objects with limited output.

Description

Blocks.searchBlock( name, langCode );

Parameters schema

Schema

name(required): string
Search string
example: "product_block"

langCode: string
Language code. Default: "en_US"
example: "en_US"

Examples

Minimal example

const value = await Blocks.searchBlock('my-marker');

Example with attributes

const value = await Blocks.searchBlock('my-marker', 'en_US');

Example response

[
{
"id": 5,
"identifier": "another",
"name": "another"
},
{
"id": 2,
"identifier": "similar",
"name": "similar"
}
]

Response schema

Schema: ISearchBlock[]

id: number
Unique identifier of the search block.
example: 1

identifier: string
Unique string identifier for the search block.
example: "search_block_1"

name: string
Name of the search block.
example: "Search Block 1"