Link-preview widget

The link-preview widget displays an image and text for a link.

Properties

Property

Description

Data type

context

JSONClosed containing the properties that define the visual appearance of the item, as described in Context properties.

string (JSON)

id

Unique identifier of this widget.

string

launchMode

Specifies whether the link opens in a new tab (tab) or on the same page (parent).

enum

metaDescription

URL meta description on the page.

string (URL)

metaImgSrc

URL meta image on the page.

string (URL)

metaTitle

URL meta title on the page.

string (URL)

metaUrl

URL loaded when user clicks the preview link.

string (URL)

size

Specifies the size of the link preview relative to the height of the default transcript area. Supported values are:

  • small: The link preview is one quarter of the height of the default transcript area.

  • large: The link preview is half height of the default transcript area.

Default value is large.

enum

type Rich-media type, which is always LinkPreview. string

Context properties

Context property

Description

Data type

descriptionColor

Meta description color, as a hex color code.

string (hex color code)

titleColor

Meta title color, as a hex color code.

string (hex color code)

Code sample

var obj = {
    "widgetType": "form",
    "widgetView": "inline",
    "nodes":
    [{
            "id": "view1",
            "controls": {
                "0": {
                    "type": "LinkPreview",
                    "id": "lp1",
                    "metaUrl": "https://www.att.com/buy/phones/apple-iphone-11-64gb-purple.html",
                    "metaImgSrc": "https://www.att.com/catalog/en/idse/Apple/Apple iPhone 11/Purple-hero-zoom.png",
                    "metaTitle": "iPhone 11 - $700 Savings, Switch & Trade-In - AT&T",
                    "metaDescription": "Switch to AT&T & get up to $700 in
                    bill credit when you buy an iPhone 11 online plus trade-in of
                    eligible smartphone & qualifying installment and data plans.  ",
                    "launchMode": "parent",
                    "context": {
                        "itemBackground": "#f5f5f5",
                        "itemBorder": "#e3e3e3",
                        "itemBorderRadius": 4,
                        "titleColor": "#0088cc"
                    }
                }
            }
        }
    ],
    "transitions": [

    ],

    "initialView": "view1"
}{
    "widgetType": "form",
    "widgetView": "inline",
    "nodes":
    [{
            "id": "view1",
            "controls": {
                "0": {
                    "type": "LinkPreview",
                    "id": "lp1",
                    "size": "small",
                    "metaUrl": "https://www.att.com/buy/phones/apple-iphone-11-64gb-purple.html",
                    "metaImgSrc": "https://www.att.com/favicon.ico",
                    "metaTitle": "iPhone 11 - $700 Savings, Switch & Trade-In - AT&T",
                    "metaDescription": "Switch to AT&T & get up to $700 in bill
                    credit when you buy an iPhone 11 online plus trade-in of
                    eligible smartphone & qualifying installment and data plans.  ",
                    "launchMode": "parent",
                    "context": {
                        "itemBackground": "#f5f5f5",
                        "itemBorder": "#e3e3e3",
                        "itemBorderRadius": 4,
                        "titleColor": "#0088cc"
                    }
                }
            }
        }
    ],
    "transitions": [

    ],

    "initialView": "view1"
}