ContentBlockByName
→ stringRenders a Content Builder asset by its folder path and name, returning the rendered HTML.
Available in:
Email
CloudPage
Automation
Triggered Send
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);