Tutorial banner

This schema is the tutorial banner example used in several tutorials and examples. It is a simple banner with headline, strapline, a background image and a call to action.

Pre-requisites

None. This is a self contained schema. Just register it as a content type and use it to create content.

How to use

This example is useful for getting familiar with Dynamic Content schemas, adding your own validation and additional properties, for example.

When you register the schema as a content type, you can add a visualization with the following URL:

https://s3-eu-west-1.amazonaws.com/amp-product/tutorials/dynamiccontenttutorials/tutorialbannervizl.html
?api={{vse.domain}}&content={{content.sys.id}}

For more information see the creating a visualization page.

Tutorial banner

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schema-examples.com/tutorial-banner",
  "title": "Tutorial banner",
  "description": "The banner used in the developer tutorials",
   "allOf": [
    { "$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/content" }
  ],
  "propertyOrder": [
        "headline", 
      "strapline", 
      "background", 
      "calltoactiontext", 
      "calltoactionurl" 
    ],
  "type": "object",
      "properties": {
         "background":
               {
               "allOf": [
            {
              "$ref": "http://bigcontent.io/cms/schema/v1/core#/definitions/image-link"
            }
            ],
            "title": "Background image",
            "description": "The background image for the banner",
            "type": "object"
            },
            "headline": {
                "title": "Headline",
                "description": "The main title of this banner",
                "type": "string",
                "format": "text",
                "minLength": 5,
                "maxLength": 256
           },
               "strapline":{
                   "title":"Strapline",
                "description": "The subtitle for this banner",
                  "type": "string",
                  "format": "text",
                 "maxLength": 256
              },
               "calltoactiontext":{
                   "title":"Call to action text",
                "description": "The text you want displayed with the call to action",
                     "type": "string",
                     "format":"text",
                "maxLength": 256
               },
               "calltoactionurl":{
                   "title": "Call to action URL",
                   "description": "The URL for the call to action",
                     "type": "string",
                     "format": "uri",
                "maxLength": 256
               }

  }
}

Content form preview

An example of creating a content item using a content type registered from the tutorial banner example schema is shown in the image below.

Creating content from the banner content type
Creating content from the banner content type

results matching ""

    No results matching ""