Manage text variables within design templates.
Text variables enable dynamic content replacement in design templates. Variables are stored as key-value pairs and can be referenced in text blocks for automated content updates.
// Configure a text block that displays 'Hello, World'const block = cesdk.engine.block.create('text');cesdk.engine.block.setText(block, 'Hello, {{name}}!');cesdk.engine.variable.setString('name', 'World');
Variable Management#
Create, update, retrieve, and remove text variables from the engine.
findAll()#
Get all text variable names currently stored in the engine.
Returns#
string
[]
List of variable names.
Signature#
findAll(): string[]
setString()#
Set a text variable’s value.
Creates a new variable if the key doesn’t exist, or updates an existing one.
Parameters#
Parameter | Type | Description |
---|---|---|
key | string | The variable’s key. |
value | string | The text value to assign to the variable. |
Returns#
void
Signature#
setString(key: string, value: string): void