---
schema_version: "1"
id: 88baa4c47f425e445b90c360524b9a099f248e85516668d082baf5dc07165ba8
title: "Handlebars Helper Function: if"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/comparison/mcn-handlebars-reference-comparison-if.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-comparison-references/mcn-handlebars-reference-comparison-if.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: bed6d7b7346b0c6fc85b5a3da79bdb73014503b6966c0c6ce0c7a232d380bebb
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars 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.

## Availability

This helper is available in the Winter ’26 release of Marketing Cloud Next.

## Syntax

```handlebars
{{#if condition}}
  <!-- Content when condition evaluates to true -->
{{else if condition2}}
  <!-- Content when condition2 evaluates to true -->
{{else}}
  <!-- Content when condition and condition2 evaluate to false -->
{{/if}}
```

## Parameters

| Parameter   | Type | Description                      |
| ----------- | ---- | -------------------------------- |
| `condition` | Any  | Required. The value to evaluate. |

## Return Value

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.

## See Also

- _Github_: [Handlebars.Net](https://github.com/Handlebars-Net/Handlebars.Net)
- _Handlebars Language Guide_: [Built-in Helpers](https://handlebarsjs.com/guide/builtin-helpers.html#if)
