The next generation content form includes two ways of specifying the layout of a form: tabs and grids. These features allow you to specify how properties in the form are laid out and to make the form easier to use by grouping related properties together.
The span of each group of columns and the properties it contains
The span parameter specifies how many columns each column group takes up. Each item in the columns arrays includes span and a pointers array containing the properties contained within it.
In the example schema shown below, the image properties are grouped together in a grid divided into 12 columns, with each property laid out using 6 columns, or half the available space.
The content form for the example grid schema is shown below. The Image Link and Image SVG are aligned in one section of the grid, while Image Alt Text, Image URL and Image Link target are grouped on the other.
The tabs component allows you to organise your form so it can be navigated using tabs. You may choose to add advanced options in a separate tab and keep the most commonly used properties in the main tab, for example.
Specify the tab labels, the default tab and the properties that will be included in each tab.
You can find a more advanced tabs example, with vertical tabs, in the schema examples.
The name of the tab that will be selected initially
orientation
How the tabs are displayed. horizontal (default) or vertical
variant
default or outline. Should an outline be displayed around the selected tab.
grow
true or false (default). Should the tabs expand to fit the size of the form.
items
An array of tabs. For each entry in the items array there is a label and a pointers array that contains the property names in JSON pointer format. See example.
A divider is a line of variable width, with an optional label. It’s particularly useful for labelling groups of properties to create notional sections that don’t impact output.
In the example below, the numberDivider property includes a label and has a line size set to medium. The divider will not be included in the JSON output for the content item.
In this example the divider acts as a heading for a group of number properties (taken from the number schema example).
The field set allows you to group items together, display them with a text label, and choose a style variant to differentiate these items from other fields in the form.
The style of field set box. default a round cornered bounding box with no fill. (Used if no variant is specified) filled filled with the background color and no bounding box line. unstyled just the title, no bounding box and no fill.
radius
The radius of the bounding box (if shown) xssm, md, lg, xl or xxl.
The content form for the field set example schema is shown below. The "Media configuration" group of fields uses the default style, while the "Fields with validation" field set uses the fill variant to make it stand out from the rest of the form.
The field set grid component combines the features of Grids and Field sets to group related fields in a grid with a title and customizable style. This helps differentiate the fields from the rest of the form and improves the content entry process for users.
The span of each group of columns and the properties it contains
variant
The style of field set box. default a round cornered bounding box with no fill. (Used if no variant is specified) filled filled with the background color and no bounding box line.
The span parameter specifies how many columns each column group takes up. Each item in the columns arrays includes span and a pointers array containing the properties contained within it.
An example field set grid schema example is shown below. This uses the same example as the Grid example with image properties grouped together in a grid divided into 12 columns and each property using half the available space. The field set grid object is configured to fill the background, as well as showing the object title.
{ "$schema":"http://json-schema.org/draft-07/schema#", "$id":"https://schema-examples.com/field-set-grid", "title":"Next generation schema examples: field set grid", "description":"An example of fields arranged in a field set grid", "allOf":[ { "$ref":"http://bigcontent.io/cms/schema/v1/core#/definitions/content" } ], "type":"object", "properties":{ "imageLinkGrid":{ "title":"Image configuration", "type":"object", "properties":{ "imageLink":{ "title":"Image Link", "allOf":[ { "$ref":"http://bigcontent.io/cms/schema/v1/core#/definitions/image-link" } ] }, "imageAltText":{ "type":"string", "title":"Image alt text", "ui:component":{ "name":"text-area", "params":{ "placeholder":"Description of image for alt tag" } } }, "isSVG":{ "type":"boolean", "title":"Image SVG", "description":"Check if image is an SVG" }, "imageLinkHref":{ "type":"string", "title":"Image Link", "format":"uri", "ui:component":{ "name":"text-area", "params":{ "placeholder":"https://..." } } }, "imageTarget":{ "title":"Image Link Target", "type":"string", "oneOf":[ { "title":"New Tab", "const":"_blank" }, { "title":"Same Tab", "const":"_self" } ] } }, "ui:component":{ "name":"fieldset-grid", "params":{ "variant":"filled", "numColumns":12, "columns":[ { "span":6, "pointers":[ "/imageLink", "/isSVG" ] }, { "span":6, "pointers":[ "/imageAltText", "/imageLinkHref", "/imageTarget" ] } ] } } } }, "propertyOrder":[] }