Handlebars Helpers Reference
Handlebars-style block helpers for control flow and context management in Scryber templates.
On this page
Overview
Handlebars helpers provide familiar syntax for common template patterns like iteration, conditionals, and context switching. They compile to native Scryber XML elements at parse time.
Block Helpers
These helpers use {{#helper}}...{{/helper}} syntax to wrap content.
| Helper | Description | Special Variables |
|---|---|---|
| Iterate over arrays and collections | @index, @first, @last |
|
| Switch data context to a specific object | this, ../ |
|
| Conditional rendering based on expressions | - |
Branch Helpers
These helpers work within block helpers to create conditional branches.
| Helper | Description | Used With |
|---|---|---|
| Alternative condition branch | {{#if}} |
|
| Fallback branch when conditions are false | {{#if}}, {{#each}}, {{#with}} |
Utility Helpers
| Helper | Description | Usage |
|---|---|---|
| Debug output to console/trace | {{log model.value level="debug"}} |
Common Patterns
Iteration with Conditionals
Context Switching with Parent Access
Multiple Conditions
See Also
- Expression Functions - Built-in functions for data manipulation
- Binding Operators - Mathematical, comparison, and logical operators
- Data Binding Guide - Complete guide to data binding