Handlebar Helper Function: If

Conditionally renders a block based on whether a value evaluates to true. This built-in helper is provided by the Handlebars.Net library.

ParameterTypeDescription
conditionanyRequired. The value to evaluate.

The function renders the block template if the condition evaluates to true. If an {{else}} block is provided, it renders that block when the condition evaluates to false. The helper also supports {{else if}} blocks for multiple conditions.