Skip to main content
Platform
Language

Kind

In this example, we will show you how to use the CreativeEditor SDK's CreativeEngine to modify a and query the kind property of design blocks through the block API.

The kind of a design block is a custom string that can be assigned to a block in order to categorize it and distinguish it from other blocks that have the same type. The user interface can then customize its appearance based on the kind of the selected blocks. It can also be used for automation use cases in order to process blocks in a different way based on their kind.

Setup#

This example uses the headless CreativeEngine. See the Setup article for a detailed guide. To get started right away, you can also access the block API within a running CE.SDK instance via cesdk.engine.block. Check out the APIs Overview to see that illustrated in more detail.

setKind(id: DesignBlockId, kind: string): void

Set the kind of the given block, fails if the block is invalid.

  • id: The block whose kind should be changed.
  • kind: The new kind.
  • Returns The block's kind.
getKind(id: DesignBlockId): string

Get the kind of the given block, fails if the block is invalid.

  • id: The block to query.
  • Returns The block's kind.
findByKind(kind: string): DesignBlockId[]

Finds all blocks with the given kind.

  • kind: The kind to search for.
  • Returns A list of block ids.