Skip to main content

Tutorial slot

This schema snippet shows how to create a slot that can contain the tutorial banner and tutorial carousel.

The slotContent is an array of up to 5 banners or carousels. This property is included in the required properties, so when you add a slot created from this schema to an edition, you must add some content for the slot to be valid. See adding the slot to an edition on this page for more details.

Pre-requisites
Link copied!

You will need to have registered the tutorial banner and tutorial carousel schemas in order to add content those created from these content types to this slot.

How to use
Link copied!

If you don't want to use the tutorial banner and tutorial carousel with this slot, you can update the contentTypes array to include your own content types.

Tutorial slot example
Link copied!

{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schema-examples.com/tutorial-slot",

"title": "Tutorial slot",
"description": "A slot that can contain a tutorial banner or tutorial carousel",

"allOf": [
{
"$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content"
}
],

"type": "object",
"properties": {
"slotContent":{
"title": "Content",
"description": "description",
"type": "array",
"minItems": 0,
"maxItems": 5,
"items": {
"allOf": [
{ "$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content-link" },
{
"properties": {
"contentType": {
"enum": [
"https://schema-examples.com/tutorial-banner",
"https://schema-examples.com/tutorial-carousel"
]
}
}
}
]
}
}

},
"propertyOrder": [],
"required": [
"slotContent"
]
}

Content form preview
Link copied!

An example of creating a slot item using a slot type registered from the tutorial slot schema is shown in the image below. When you create a slot in the Content Library, you'll add some dummy content. In the image below a carousel and a banner have been added.

Creating a slot from the tutorial slot type.

Adding the slot to an edition
Link copied!

When a slot created from this slot type is added to an edition, the slot validation is shown as "Requires content" which means that some content must be added to the slot, otherwise it does not pass slot validation and the edition cannot be scheduled. The slot must contain content because the slotContent property in the example schema is required.

description

When content has been added, the slot is valid and the edition can be scheduled.

With content added to the slot the edition can be scheduled

Slots