ContentBlockByName

Overview

Retrieve content from a specified content block in Content Builder. This function will only work with shared content in a business unit if it is shared using a shared folder.

Syntax

ContentBlockByName(1, 2, 3, 4, 5)

Function Properties

Ordinal Type Description
1 string Required Name of the content block to return, including the path within the my contents folder if necessary
2 string Impression region for content
3 Boolean Indicates whether the function returns an error when the system cannot locate the specified content area or returns an invalid content area. A value of true returns an error. A value of false does not return an error.
4 string Default content to return if an error occurs and no error returns. This value defaults to an empty string.
5 string Returns the status of the call. A value of 0 indicates the function found the content area and successfully rendered the content. A value of -1 indicates either no content or an invalid content area, so the function returns the default content value.

Example

<script runat="server">
var content = Platform.Function.ContentBlockByName("Content Builder\\Content One");
Platform.Response.Write(content);
</script>
Last Updated: Jun 8, 2021