Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion content/docs/widgets.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ To see working examples of all of the built-in widgets, try making a 'Kitchen Si

The following options are available on all fields:

- `required`: specify as `false` to make a field optional; defaults to `true`
- `hint`: optionally add helper text directly below a widget. Useful for including instructions. Accepts markdown for bold, italic, strikethrough, and links.
- `pattern`: add field validation by specifying a list with a [regex pattern](https://regexr.com/) and an error message; more extensive validation can be achieved with [custom widgets](../custom-widgets/#advanced-field-validation)
- **Example:**
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/boolean.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The boolean widget translates a toggle switch input to a true/false value.
- **Data type:** boolean
- **Options:**
- `default`: accepts `true` or `false`; defaults to `false` when `required` is set to `false`
- `required`: specify as `false` to make a field optional; defaults to `true`
- **Example:**
```yaml
- {label: "Draft", name: "draft", widget: "boolean", default: true}
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/code.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ The code widget provides a code editor (powered by [Codemirror](https://codemirr
- **UI:** code editor
- **Data type:** string
- **Options:**
- `required`: specify as `false` to make a field optional; defaults to `true`
- `default_language`: optional; default language to use
- `allow_language_selection`: optional; defaults to `false`: allows syntax to be changed
- `keys`: optional; sets key names for code and lang if outputting an object; defaults to `{ code: 'code', lang: 'lang' }`
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/color.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The color widget translates a color picker to a color string.
- **Data type:** string
- **Options:**
- `default`: accepts a string; defaults to an empty string. Sets the default value
- `required`: specify as `false` to make a field optional; defaults to `true`
- `allowInput`: accepts a boolean, defaults to `false`. Allows manual editing of the color input value
- `enableAlpha`: accepts a boolean, defaults to `false`. Enables Alpha editing
- **Example:**
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/datetime.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The datetime widget translates a datetime picker to a datetime string.
- `default`: accepts a datetime string, or `'{{now}}'` to fill in the current datetime; otherwise defaults to empty string.

<small>Until 3.2.1 it defaults to current datetime. To get an empty field, set default to empty string.</small>
- `required`: specify as `false` to make a field optional; defaults to `true`
- `format`: sets storage format, displays the full date and time input in the UI. Accepts [Day.js formats](https://day.js.org/docs/en/display/format); defaults to ISO8601 (if supported by output format). If set, `date_format` and `time_format` are not used.
- `date_format`: sets storage format and UI input type as date picker (without time). Boolean or [Day.js formats](https://day.js.org/docs/en/display/format).
- `time_format`: sets storage format and UI input type as time picker (without date). Boolean or [Day.js formats](https://day.js.org/docs/en/display/format). If used together with `date_format`, the UI input will be a full datetime picker.
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The file widget allows editors to upload a file or select an existing one from t
* **Options:**

* `default`: accepts a file path string; defaults to null
- `required`: specify as `false` to make a field optional; defaults to `true`
* `media_library`: media library settings to apply when a media library is opened by the
current widget

Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/hidden.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Hidden widgets do not display in the UI. In folder collections that allow users
- **Data type:** any valid data type
- **Options:**
- `default`: accepts any valid data type; recommended for collections that allow adding new items
- `required`: specify as `false` to make a field optional; defaults to `true`
- **Example:**
```yaml
- {label: "Layout", name: "layout", widget: "hidden", default: "blog"}
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/image.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The image widget allows editors to upload an image or select an existing one fro
* **Options:**

* `default`: accepts a file path string; defaults to null
* `required`: specify as `false` to make a field optional; defaults to `true`
* `media_library`: settings to apply when a media library is opened by the
current widget
* `allow_multiple`: *(default: `true`)* when set to `false`, multiple selection will be disabled even if the media library extension supports it
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The list widget allows you to create a repeatable item in the UI which saves as
field, or an array of list items for lists using the `fields` option. If no
default is declared when using `field` or `fields`, will default to a single
list item using the defaults on the child widgets
* `required`: specify as `false` to ignore `min`, `max` setting; defaults to `true`. If `true` and `min`,`max` values are set, list widget validates number of items
* `allow_add`: `false` hides the button to add additional items
* `collapsed`: when `true`, the entries collapse by default
* `summary`: specify the label displayed on collapsed entries
Expand Down
3 changes: 2 additions & 1 deletion content/docs/widgets/map.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ The map widget allows you to edit spatial data using an interactive map. Spatial

* `decimals`: accepts a number to specify precision of saved coordinates; defaults to 7 decimals
* `default`: accepts a GeoJSON string containing a single geometry; defaults to an empty string
* `required`: specify as `false` to make a field optional; defaults to `true`
* `type`: accepts one string value of `Point`, `LineString` or `Polygon`; defaults to `Point`
* **Example:**

```yaml
- {label: "Location", name: "location", widget: "map" }
```
```
1 change: 1 addition & 0 deletions content/docs/widgets/markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The markdown widget provides a full fledged text editor allowing users to format
* **Options:**

* `default`: accepts markdown content
* `required`: specify as `false` to make a field optional; defaults to `true`
* `minimal`: accepts a boolean value, `false` by default. Sets the widget height to minimum possible.
* `buttons`: an array of strings representing the formatting buttons to display (all shown by default). Buttons include: `bold`, `italic`, `code`, `link`, `heading-one`, `heading-two`, `heading-three`, `heading-four`, `heading-five`, `heading-six`, `quote`, `bulleted-list`, and `numbered-list`.
* `editor_components`: an array of strings representing the names of editor components to display (all shown by default). Decap CMS includes `image` and `code-block` editor components by default, and custom components may be [created and registered](/docs/custom-widgets/#registereditorcomponent).
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/number.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The number widget uses an HTML number input, saving the value as a string, integ
- **Data type:** string by default; configured by `value_type` option
- **Options:**
- `default`: accepts string or number value; defaults to empty string
- `required`: specify as `false` to make a field optional; defaults to `true`
- `value_type`: accepts `int` or `float`; any other value results in saving as a string
- `min`: accepts a number for minimum value accepted; unset by default
- `max`: accepts a number for maximum value accepted; unset by default
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/relation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The relation widget allows you to reference items from another collection. It pr
* `file`: allows referencing a specific file when the referenced collection is a files collection (string)
* `display_fields`: list of one or more names of fields in the referenced collection that will render in the autocomplete menu of the control. Defaults to `value_field`. Syntax to reference nested fields is similar to that of *value_field*.
* `default`: accepts any widget data type; defaults to an empty string
* `required`: specify as `false` to make a field optional; defaults to `true`
* `multiple` : accepts a boolean, defaults to `false`
* `min`: minimum number of items; ignored if **multiple** is `false`
* `max`: maximum number of items; ignored if **multiple** is `false`
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/select.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ The select widget allows you to pick a string value from a dropdown menu.

* string values: accepts a string; defaults to an empty string. Accepts an array of strings and defaults to an empty array with `multiple: true` enabled.
* object with `label` and `value` fields: accepts an object with `label` and `value` field or an array of such objects when `multiple: true` is enable. Defaults to no value
* `required`: specify as `false` to make a field optional; defaults to `true`
* `options`: (**required**) there are two ways to list of options for the dropdown menu:

* string values: the dropdown displays the value directly
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/string.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The string widget translates a basic text input to a string value. For larger te
- **Data type:** string
- **Options:**
- `default`: accepts a string; defaults to an empty string
- `required`: specify as `false` to make a field optional; defaults to `true`
- **Example:**
```yaml
- {label: "Title", name: "title", widget: "string"}
Expand Down
1 change: 1 addition & 0 deletions content/docs/widgets/text.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The text widget takes a multiline text field and saves it as a string. For short
- **Data type:** string
- **Options:**
- `default`: accepts a string; defaults to an empty string
- `required`: specify as `false` to make a field optional; defaults to `true`
- **Example:**
```yaml
- {label: "Description", name: "description", widget: "text"}
Expand Down