Appearance
Template
The Template node renders a template string with embedded expressions for each input row. Use it to build formatted text, HTML snippets, email bodies, or any string output.
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
template | string | -- | Required. A template string with { { }} or <{ }> expression blocks. |
outputField | string | _text | The field name where the rendered text is stored on each row. |
Input
Accepts a single object or an array of rows.
Output
- Single object: The rendered text is added as
outputField. - Array of rows: Each row gets the rendered text as
outputField. - Non-array input: Returns the rendered string directly.
Template Syntax
{ { expression }} -- Escaped text output
Evaluates the expression and escapes the result for safe display:
Hello, `{ {row.name}}`! You have `{ {row.count}}` items.<{ expression }> -- Raw HTML output
Evaluates the expression and sanitizes via wp_kses_post() (allows safe HTML tags):
<{content(row.post_content)}>Expression Context
| Variable | Description |
|---|---|
row | The current row being processed |
input | Same as row (for single-object input) |
Example Templates
Simple greeting
Welcome back, `{ {row.display_name}}`!Email body
Dear `{ {row.name}}`,
Thank you for your order #`{ {row.order_id}}`.
Total: $`{ {number_format(row.total, 2)}}`
Best regards,
The TeamHTML content rendering
<{content(row.post_content)}>Conditional text
Status: `{ {row.status == 'active' ? 'Active' : 'Inactive'}}`Example Use Cases
Generate email content in a form pipeline
Context --> Validate --> Template (email body) --> Send Email --> OutputCreate display labels
Table Query --> Template ("`{ {row.first_name}}` `{ {row.last_name}}`") --> ResultBuild custom URLs
template: "/products/`{ {slug(row.title)}}`-`{ {row.id}}`"
outputField: "url"TIP
The Template node is ideal for multi-line text with embedded expressions. For setting a single field to a computed value, the Set Field node is simpler.