ContentImageByID
→ stringReturns an HTML img element pointing at a Content Builder image identified by numeric asset ID. Optionally supply a fallback ID if the primary asset is missing.
Available in:
Email
CloudPage
Automation
Triggered Send
Syntax
Platform.Function.ContentImageByID(id[, fallbackId])
1–2 arguments
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
id |
number | Yes | Numeric ID of the image in Content Builder |
fallbackId |
number | No | ID of a replacement image when the primary cannot be resolved |
Return value
A string containing an img tag (including typical attributes such as src, alt, and title as provided by the platform).
Examples
var banner = Platform.Function.ContentImageByID(1234567);
Write(banner);
var icon = Platform.Function.ContentImageByID(555, 999);
Write(icon);