The Columns field works almost exactly like the Rows field, except it displays the added row objects as columns instead.
Editing UI Widget
This field is displayed as a list of sub-fields labelled by its label
. Depending on its configuration, there may or may not be a button to add additional columns to the field.
Output Format
The Columns field outputs either an array of objects or an array of a single type if it only has one type of column and that column is not a Field Group field. If multiple types of column are allowed, each object in the array will have a ___mb_type
property holding the key
of the sub-field it represents.
Options
The following options are available for this field (default values shown):
{
"allowEditing": true,
"itemLabel": "Row"
}
allowEditing: controls whether or not Content Editors may add or remove column while editing content
itemLabel: the label to use in order to refer to a column
Validation
The following validation options are available for this field (default values shown):
{
"max": null,
"min": null,
"unit": "columns"
}
Notes
This field’s functionality is identical to that of a Rows field, but in some cases it may be preferable to display dynamic content in the form of columns instead of rows. For example, a Columns field is a perfect fit for image galleries, or pricing tiers.
As opposed to a the rows of a Rows field, the columns of a columns field are always displayed in their compact form to avoid visual clutter. There will also never be more than three columns displayed in a single row to ensure that text remains readable.
If you are simply looking to display two fields next to each other without grouping them under a common key, you will want to use a Container field instead.
Keep in mind that like with Rows fields, adding fields that are visual only (i.e. have visualOnly
set to true
), including Container fields, as top-level children is not supported. They will not show up as addable types since they don’t contain content. If you find yourself wanting to add a Container at the top-level of a Columns field, use a Field Group instead.
Version History
Version at launch: 1