Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
excludeRelated Articles

Card

The Card directive lets allows you to render the data in the form of as a card component. This directive can be used for various purposes, besides Provider or Location cardsApart from Provider and Location cards, this directive may be used for a variety of applications. This could hold any HTML content within it.

This Card directive creates a layout that the User may use to display custom content on the Card. This Card directive, unlike the Bootstrap carousel or the Cardlist directive, has no preset parameters that regulate what is presented on the Card.

Sample

...

Snippet

Code Block

...

languagejs
{
    "type": "card",
    "items": [{
            "title": "Card Detail title",
            "imageURL": "example.com/hospitalone",  //optional
            "body": "A sample description of the Hospital and its services",
            "button": "Check more details",  //optional
            "html": "<p>provide the full HTML data</p>", // optional
            "detailDisplay": [{
                "type": "Accordion",
                "items": [{
                    "title": "Accordion One",
                    "body": `<p> Lorem Ipsum is simply dummy text</p>`
                }, {
                    "title": "Accordion Two",
                    "body": `<p> Lorem Ipsum is simply dummy text</p>`
                }]
            }]
        }
    },
    {
        "title": "Card Detail title",
        "imageURL": "", //optional
        "body": "",
        "button": "", //optional
        "html": "", // optional
        "detailDisplay": [{
            "type": "Accordion",
            "items": [{
                "title": "Accordion three",
                "body": `<p> Lorem Ipsum is simply dummy text</p>`
            }, {
                "title": "Accordion four",
                "body": `<p> Lorem Ipsum is simply dummy text</p>`
            }]
        }]
    }
}],
"filterButton": false
}


Please add the above snippet in the Chatbot Settings under the directive object or use the Function node in the Experience Designer to construct the msg.payload.orbita.directive to prepare the Directive data. The latter takes priority over the former method.

The Card directive can be used to display a single card. We can make a Carousel using this directive by adding more Card objects to the Array.

The Card component will render only one card item with navigation arrows, irrespective of the page screen width. User can use the buttons to navigate to other cards.

Parameters used for Carousel

Property

Description

"type": "carouselcard"

This property accepts carousel, bootstrapcarousel, and card options card as the option to identify this directive as Card.

"items": [{
"reviewstitle": {...}"",
"titleimageURL": "title", // optional
"descriptionbody": "desc",
"imagebutton": {...},"", // optional
"detailViewhtml": {...}
}"", // optional
}]

The items property is used to fill the carousel options. Each carousel option holds an Array of Card data and this is displayed on the Bot. Each Card object can have the below properties.

  • reviews

  • title

  • description

  • image

  • detailView

"title": "Title for Carousel",

The Title of the carousel option.

"reviews": {
"rating": 2.5,
"label": "Reviewslabel",
"count": 20000
}

This is an optional property. You can show the rating on the carousel options and in the detailed view using this property.

  • rating - This is the calculated rating value. The rating stars will get filled based on the number given here. (hardcoded in the sample code).

  • label - You can set a custom name to the rating icon. (Can only be seen in Detailed view)

  • count - The total number of ratings received. (Can only be seen in Detailed view)

"description": "Description for Carousel Option",

The description of the Carousel Option.

"image": {
"alternateText": "altimg",
"url": "Imageurl"
}

Paste the appropriate image URL that you uploaded to Orbita. Recommended size is 225px width and 135px height.

"detailView": {
"title": "Detailed title",
"description": "Detail Desc",
"image": {
"url": "ImgURL",
"alternateText": "OE"
},
"buttons": [{
"text": "Button Text",
"type": "link",
"value": "URL"
}]
}

Clicking on the Carousel option will open the detailed view window. The below mentioned are the properties it contains.

  • title - Title of the detailed view page.

  • description - Description of the detailed view page.

  • image - Recommended size is 620px width and 290px height.

  • buttons -You can set an optional floating button at the end of the detailed view using this property.

    • text - Button display name.

    • type - Button type (for example, “link”)

    • value - redirect link.

  • review - The review object will be rendered in the detailed view to show the rating.

Carousel options

The below image shows where each property would be rendered on a carousel.

...

detailedView of the carousel

The below image shows where each property would be rendered on the detailedView of the carousel.

...

Sample flow

Attachments
previewfalse
uploadfalse
oldfalse
patterns*.json

The properties are tied to default CSS styles.

  • title - Title for the Card to be given here

  • imageURL - An Image URL should be provided here

  • body- The main body for the Card to be provided. It will use default styling on the Card

  • button- Action item can be given here.

  • html- This property holds the full Card content in HTML format. This property takes priority over other properties above.

"detailView": {
"content": {...}

}

The property detailView defines the content for the Detail view of the Card.

The properties inside this, namely the content works the same way defined for the main card.

"filterButton": false

The functionality for the Filter page is under development. Please have the property set to false until further change.

Accordion

The Accordion component can be added as part of the Card’s detailed view. This is optional and will help render the accordion content.

The snippet used to explain the Card has the sample for the Accordion also.

...

Snippet

The below snippet is to highlight the Accordion component alone.

Code Block
"detailDisplay": [{
					"type": "Accordion",
                    "method" : "flush",					
                    "items": [{
							"title": "Accordion three",
							"body": `<p> Lorem Ipsum is simply dummy text</p>`
						},
						{
							"title": "Accordion four",
							"body": `<p> Lorem Ipsum is simply dummy text</p>`
						}
					]
				}]


Please add the above snippet in the Chatbot Settings under the card directive object or use the Function node in the Experience Designer to construct the msg.payload.orbita.directive to prepare the Directive data. The latter takes priority over the former method. We can add an array of Accordion content inside the items object as required.

Parameters used for Carousel

Property

Description

"type": "Accordion"

This property accepts Accordion as the option to identify this as the Accordion component inside the Card detail page overlay in the detailDisplay object.

"method" : "flush"

This property accepts values "flush" or "Always-open". This controls the Accordion design type as either Flush design or Collapse/ Expand design.
To experience the difference, please visit https://getbootstrap.com/docs/5.0/components/accordion/

"items": [{
"title": {...},
"body": {...}
}]

The items property holds an Array of Accordion data and this is displayed on the detailed page. The items array can have the below properties.

  • title

  • body

Tabs

The Tabs component can be added as part of the Card directive’s detailed view. This component is optional and will help render the Tabs content. The component is tightly coupled with the Card directive detail page.

...

Snippet


The below snippet is to highlight the Tab component along with the Accordion component.

Code Block
{
	"type": "card",
	"items": [{
		"content": `<h1>Card component Two<h1>`,
		"detailView": {
			"title": "Card Detail title",
			"content": `<h1> Card detail view ${i+1} </h1>`,
			"detailDisplay": [{
                type: "Tab",
                items: [{
                        title: "Tab one",
                        content: "<p>sample tab one</p>",
                    },
                    {
                        title: "Tab two",
                        content: "<p>sample tab two</p>"
                    }]
            },{
					"type": "Accordion",
					"items": [{
						"title": "Accordion three",
						"body": `<p> Lorem Ipsum is simply dummy text</p>`
					}]
				}				
			]
		}
	}],
	"filterButton": false
}


Please add the above snippet in the Chatbot Settings under the card directive object or use the Function node in the Experience Designer to construct the msg.payload.orbita.directive to prepare the Directive data. The latter takes priority over the former method. We can add an array of Tab content inside the items object as required.

Parameters used for Carousel

Property

Description

"type": "Tab"

This property accepts Tab as the option to identify this as the Tab component inside the Card detail page overlay in the detailDisplay object.

"items": [{
"title": {...},
"content": {...}
}]

The items property holds an Array of Tab data and this is displayed on the detailed page. The items array can have the below properties.

  • title

  • content

Related Articles

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel = "experience-managerdirective"