Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Overview

The standard user interface through DDNA Studio provides the opportunity to make conversations multi-modal through supplemental content and displays known as ‘Content Blocks’. By sending additional data from your conversation platform, you are able to display richer content at relevant points of the conversation along with the spoken audio stream.

Panel
panelIconId26a1
panelIcon:zap:
panelIconText
bgColor#FFFAE6

Tip: We recommend you use the Content Cards Skill to simplify this process for External Links, Video, and Markdown cards.

Prerequisites and Known Limitations

Info

Note: This guide only applies to the Default UI and the Widget through the Digital DNA Studio. If you are building your own custom UI, this guide does not apply and you should consult Building Content Cards .

Using Content Blocks

To enable the display of rich content, our standard user interface offers the following content options: Images, Lists, Links, Markdown, and Video.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#EAE6FF

Info: It is important to associate each card with a unique Id, this is used in content awareness (developer docs, high level docs), so the Digital Person can glance at it.

Info

Note: It is recommended to use the custom payload option in Dialogflow ES and CX to define content cards.

Single Images
Status
colourPurple
titleDEFAULT UI
Status
colourGreen
titleWidget

Displays a single image, either from a URL or encoded string.

Panel
panelIconIdatlassian-info
panelIcon:info:
bgColor#EAE6FF

Info: The general recommendation would be to use images of 960 x 960 pixels at 72-144px DPI and/or a file size of 100kb or less.

Payload

The payload must be in a valid JSON format.

Code Block
languagejson
{
  "type": "image",
  "id": "image",
  "data": {
	"url": "https://placekitten.com/500/500",
	"alt": "This is a cat"
  }
}

Properties

Available within the “data” attribute of the payload.

URL
required

A url or base64 encoded string representing an image.

URL

When using a url, the url must be accessible by the UI. For example, if the UI is accessed via https, then image URLs must also be accessed using https.

Use the prefix // to access the image using the same protocol at the host UI. The hosted image must support both http and https, if this approach is to be used.
e.g. "url": "//www.soulmachines.com/wp-content/uploads/sm-logo-retina.png"

The url must have a prefix.
e.g. "url": "soulmachines.com/wp-content/uploads/sm-logo-retina.png" will not work.

Base64 Encoded String

For base64 encoding see MDN: Data URLs or StackOverflow: How to display Base64 images in HTML

alt

Text to be used for screen readers or when the image is not available. For more information see MDN: The Image Embed Element

Example

Multiple Image Sequence
Status
colourPurple
titleDEFAULT UI
Status
colourGreen
titleWidget

You may display different images, one at a time by defining the individual data for each image in the NLP and using multiple @showCards() commands in the Conversation Response.
Example:

public-mydog

Code Block
languagejson
{
  "type": "image",
  "id": "image-dog",
  "data": {
	"url": "https://www.yoururl.com/dog.png",
	"alt": "This is a dog"
  }
}

public-mycat

Code Block
languagejson
{
  "type": "image",
  "id": "image-cat",
  "data": {
	"url": "https://www.yoururl.com/cat.png",
	"alt": "This is a cat!"
  }
}

Conversation Response

Code Block
Here is a picture of a cat @showCards(mycat) #PauseOne and here is a picture @hidecards() of a @showcards(mydog) dog.

Options
Status
colourPurple
titleDEFAULT UI
Status
colourGreen
titleWidget

Displays a collection of prompts/buttons for the user to guide them through a conversation. When an option is clicked, its value is sent through to the NLP platform in the same way as a spoken command.

Payload

The payload must be in a valid JSON format.

Code Block
languagejson
{
  "type": "options",
  "id": "options",
  "data": {
    "options": [
      { "label": "First Option", "value": "Tell me about the option one"},
      { "label": "Second Option", "value": "Tell me about the option two"},
      { "label": "Third Option", "value": "Tell me about the option three"}
    ]
  }
}

 

Properties

Available within the “data” attribute of the payload.

options
required

An array of objects where each object defines the option.

  • The property “label” is used to display text within the button / option in the UI

  • The property “value” may also be used to match a possible spoken response by the user. The list option could then be clicked as a form of selecting it (in addition to speaking the list option), e.g. the “value” property is sent to the NLP for intent matching.

Example

External Links
Status
colourPurple
titleDEFAULT UI
Status
colourGreen
titleWidget

Displays a hyperlink in the form of a clickable button, when clicked, opens the link in a new tab of the browser.

Info

Note: The UI is responsive—if the screen size is smaller than a tablet, the image is hidden.

Payload

The payload must be in a valid JSON format.

Code Block
languagejson
{
  "type": "externalLink",
  "id": "externalLink",
  "data": {
    "url": "https://www.soulmachines.com",
    "title": "Soul Machines",
    "imageUrl": "https://www.soulmachines.com/wp-content/uploads/cropped-sm-favicon-180x180.png",
    "description":"Soul Machines is the leader in astonishing AGI"
  }
}

Properties

Available within the “data” attribute of the payload.

url
required

A url string representing an external link;

E.g. “https://www.soulmachines.com

imageUrl
required

A url for an image to be displayed as the graphical support to accompany the external link.

E.g. “https://domainname.com.au/picture.jpg”

Title
required

Text that is displayed above the external link and below the image.

description
optional

Text that is displayed below the Title.

Example

Internal Links
Status
colourGreen
titleWidget

Displays a hyperlink in the form of a clickable image, when clicked, opens the link in the same tab of the browser.

Info

Note: The UI is responsive—if the screen size is smaller than a tablet, the image is hidden.

Payload

The payload must be in a valid JSON format.

Code Block
languagejson
{
  "type": "internal",
  "id": "internalLink",
  "data": {
    "url": "https://www.soulmachines.com",
    "title": "Soul Machines",
    "imageUrl": "https://www.soulmachines.com/wp-content/uploads/cropped-sm-favicon-180x180.png",
    "description":"Soul Machines is the leader in astonishing AGI"
  }
}

Properties

Available within the “data” attribute of the payload.

url
required

A url string representing an external link;

E.g. “https://www.soulmachines.com/resources/

imageUrl
required

A url for an image to be displayed as the graphical support to accompany the internal link.

E.g. “https://domainname.com.au/picture.jpg%E2%80%9D

Title
required

Text that is displayed above the internal link and below the image.

description
optional

Text that is displayed below the Title.

Example

Markdown
Status
colourPurple
titleDEFAULT UI
Status
colourGreen
titleWidget

Displays styled markdown compatible content.

Payload

The payload must be a valid JSON format, including the value of the “text” attribute, which must be escaped in order to be valid.

Code Block
languagejson
{
  "type": "markdown",
  "id": "markdown-content",
  "data": {
    "text": "## An Interesting List\r\n 1. Most interesting\r\n 2. Less interesting\r\n 3. Least Interesting"
  }
}

Properties

Available within the “data” attribute of the payload.

text
required

Static text to be displayed and not spoken by Digital Person.  Markdown markup language can be used to add formatting to this text.

For example: 
“This is **Bold **”. 

This will display as “This is Bold

The value of the text attribute must be valid JSON and must be correctly escaped (see below).

See Also

Example

Video
Status
colourPurple
titleDEFAULT UI

Displays a video player for a specific YouTube video, enabling the end-user to watch a video in line with the experience with the Digital Person.

Payload

The payload must be in a valid JSON format.

Code Block
languagejson
{
  "type": "video",
  "id": "youtubeVideo",
  "data": {
    "videoId":"vxmthHfkoaw",
    "autoclose":"true"
  }
}

Properties

Available within the “data” attribute of the payload.

videoId
required

The YouTube videoId for the video you wish to embed.
You may find your videoId on the end of the YouTube video URL i.e.
https://www.youtube.com/watch?v=vxmthHfkoaw

autoplay: Boolean
optional

Configure the video card to auto-play at the time it’s rendered by the showcardsevent.

  • When the autoplay attribute is not included in the payload, the video card will not play until the user clicks the “play” button, on all platforms.

  • When autoplay is included in the payload and set to true/false, the video will pop up to full screen and begin playing as soon as showcards is triggered for the card.

Info

Note: On most mobile devices, autoplay of videos is not supported. A video with autoplay:true automatically pop ups to cover the screen, but the user needs to click the play button to begin the video.

autoclose: Boolean (default false)
optional

Configure the video card to close automatically when the video ends.

When autoplay is set to false for a video card, the video card does not close until the user clicks the “I'm done watching” button.

When autoclose  is set totrue for a video card, the video player closes at the end of the video and enables you to immediately continue the conversation.

After Playback

If the autoclose has not been configured, the user can click the “I'm done watching” button at any time to close the video player.
At this point the text “I'm done watching” is sent to your NLP engine so you may continue the conversation—you must create an intent to match “I'm done watching” and respond accordingly.

Example

Implementing into your NLP

See Building Content Cards for NLP-specific examples and how to use Content Cards in a custom UI.

IBM Watson (classic) sample

This sample contains a set of Nodes that demonstrates how to display each of the supported content types.

  1. Download the sample .json file

  2. Import the file to your Watson skill.

View file
nameIBMWatsonExampleContentCards-210713-131046.json

Google Dialogflow ES sample

This sample contains a set of Intents that demonstrates how to display each of the supported content types.

  1. Download the sample .zip file

  2. Import the file to your Dialogflow agent.

View file
nameDialogflowExampleContentCards-210713-112743 (2).zip

Related Topics

Contents

Table of Contents