Versions Compared

Key

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

...

Code Block
languagejs
{
	"type": "card",
	"items": [{
		"content": `<h1>Card component One<h1>`,
		"contentUrl": "http://example.com/oeapi/htmltwo",
		"detailView": {
			"title": "Card Detail title",
			"content": `<h1> Card detail view ${i+1} </h1>`,
			"contentUrl": "http://example.com/oeapi/htmlone",
			"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>`
				}]
			}]
		}
	}, {
		"content": `<h1>Card component Two<h1>`,
		"contentUrl": url,
		"detailView": {
			"title": "Card Detail title",
			"content": `<h1> Card detail view ${i+1} </h1>`,
			"contentUrl": "http://example.com/oeapi/htmlthree",
			"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
}

...

Property

Description

"type": "card"

This property accepts card as the option to identify this directive as Card.

"items": [{
"content": {...},
"contentUrl": {...},
"detailView": {
"content": {...},
"contentUrl": {...},
}
],

The items property holds an Array of Card data and this is displayed on the Bot. Each Card object can have the below properties.

  • content

  • contentUrl

  • detailView

    • content

    • contentUrl

"content": {}

This property will hold the HTML content to render the main Card data.

Sample:
"content": `<h1> Card ${i+1} </h1> <img src='https://ucarecdn.com/05f649bf-b70b-4cf8-90f7-2588ce404a08/' class='d-block w-100' alt='image'>`

"contentUrl": {}

This property is optional. This can be used to host the content in a template and we must specify the endpoint here. The card will render from that endpoint.

This property take priority over the content property. This is to render the main card.

Sample:

"contentUrl": "http://localhost:3030/oeapi/html""detailView": {
"content": {...},

"contentUrl": {...},

}

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

The properties inside this, namely the content and contentUrl 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.

...

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>`
						}
					]
				}]

...

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

...

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

...

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": {...},
"contentUrl": {...}
}]

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

  • contentcontentUrl

Related Articles

Filter by label (Content by label)
showLabelsfalse
max5
showSpacefalse
cqllabel = "directive"