Syntax

ContentAreaByName(name[, regionName, errorMsg, fallbackContent])
1–4 arguments

Parameters

Name Type Required Description
name string Yes Name of the Content Area (folder path notation, e.g. "My Content\myArea").
regionName string No Impression region for content tracking.
errorMsg string No Error message returned as a string on retrieval failure.
fallbackContent string No Content to display when the area cannot be retrieved.

Description

ContentAreaByName() retrieves and renders content from a classic (legacy) SFMC Content Area identified by its name.

This function is deprecated. Classic Content Areas are no longer supported on modern SFMC infrastructure. Migrate content to Content Builder blocks and use Platform.Function.ContentBlockByName() instead.

Requires Platform.Load: This global form requires Platform.Load("core", "1.1.5") before use. The qualified Platform.Function.ContentAreaByName() form does not.

Difference from Platform.Function.ContentAreaByName()

  ContentAreaByName() (global) Platform.Function.ContentAreaByName()
3rd parameter errorMsg: string stopOnError: boolean
Requires Platform.Load Yes — Platform.Load("core", "1.1.5") No

See Platform.Function.ContentAreaByName for the qualified variant.

Examples

Platform.Load("core", "1.1.5");
var content = ContentAreaByName("My Content\\myContentArea");
Platform.Response.Write(content);
Platform.Load("core", "1.1.5");
var content = ContentAreaByName("My Content\\myContentArea", "impressionRegion", "Could not load content area", "Fallback text here");
Platform.Response.Write(content);

See Also