Syntax

ContentBlockByName(name)
1 argument

Parameters

Name Type Required Description
name string Yes The folder path and name of the Content Builder asset (e.g., "My Folder/My Block").

Description

Renders a Content Builder block by its name (and optionally its folder path) and returns the rendered HTML. Use ContentBlockByKey() when possible — it is more reliable since names can change but external keys persist.

Example

// Block in the root of Content Builder
var html = ContentBlockByName("Global Header");

// Block in a subfolder
var footer = ContentBlockByName("Shared/Footer/Standard Footer");

Write(html);
Write(footer);

See Also