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

{{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.

{{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.

{{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.

{{#if isPreferredCustomer}}
  {{getContentBlock key="preferred-customer-banner"}}
{{/if}}

See Also