---
schema_version: "1"
id: 9dcebccedacd9ebce86998449f33b5133639f9793fa151e3466ac90b80c782a4
title: "Handlebars Helper Function: getContentBlock"
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/handlebars/reference/content/mcn-handlebars-reference-content-getcontentblock.md
canonical_url: https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/mcn-handlebars-content-references/mcn-handlebars-reference-content-getcontentblock.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: dd43f127d689152efd06a02e2bd24b60e48646d9525c00455513de72806156f3
products:
  - Handlebars for Marketing Cloud Next
  - Marketing Cloud
---
# Handlebars Helper Function: getContentBlock

Retrieve and render a content block within a template.

## Availability

This helper is available in the Summer ’26 release of Marketing Cloud Next.

## Syntax

```handlebars
{{getContentBlock key="contentKey"}}
```

## Parameters

| Parameter | Type   | Description                                                       |
| --------- | ------ | ----------------------------------------------------------------- |
| `key`     | String | Required. The unique identifier of the content block to retrieve. |

## Return Value

The function returns the rendered content of the specified content block. For HTML rendering contexts, it returns the HTML part of the content. For other contexts, it returns the text part. If the content block can't be retrieved, the function throws an exception.

## Locale Support

The helper automatically extracts the locale from the rendering context. If any language-specific content variants are available, the function retrieves them based on the locale information.

## Usage Examples

This example retrieves and renders a content block.

```handlebars
{{getContentBlock key="abc123"}}
```

### Providing a Fallback Value

The function throws an exception if the specified content block doesn't exist, so it's a good idea to provide a fallback. This example provides a default if the content block isn't found.

```handlebars
{{fallback (getContentBlock key="footerblock") "Copyright 2026 Northern Trail Outfitters"}}
```

### Using in Conditional Blocks

It's often useful to render specific content blocks based on the properties of the recipient. This example conditionally includes a content block when a variable evaluates to `true`.

```handlebars
{{#if isPreferredCustomer}}
  {{getContentBlock key="preferred-customer-banner"}}
{{/if}}
```

## See Also

- [Fallback](https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/utility/mcn-handlebars-reference-utility-fallback.md)
- [If](https://developer.salesforce.com/docs/marketing/handlebars-for-marketing-cloud-next/references/comparison/mcn-handlebars-reference-comparison-if.md)
