fix: deprecate inconsistent config param case (#4172)
This commit is contained in:
@ -209,7 +209,7 @@ The `collections` setting is the heart of your Netlify CMS configuration, as it
|
||||
* `fields` (required): see detailed description below
|
||||
* `editor`: see detailed description below
|
||||
* `summary`: see detailed description below
|
||||
* `sortableFields`: see detailed description below
|
||||
* `sortable_fields`: see detailed description below
|
||||
* `view_filters`: see detailed description below
|
||||
|
||||
The last few options require more detailed information.
|
||||
@ -384,7 +384,7 @@ Template tags are the same as those for [slug](#slug), with the following additi
|
||||
summary: "Version: {{version}} - {{title}}"
|
||||
```
|
||||
|
||||
### `sortableFields`
|
||||
### `sortable_fields`
|
||||
|
||||
An optional list of sort fields to show in the UI.
|
||||
|
||||
@ -396,7 +396,7 @@ When `author` field can't be inferred commit author will be used.
|
||||
|
||||
```yaml
|
||||
# use dot notation for nested fields
|
||||
sortableFields: ['commit_date', 'title', 'commit_author', 'language.en']
|
||||
sortable_fields: ['commit_date', 'title', 'commit_author', 'language.en']
|
||||
```
|
||||
|
||||
### `view_filters`
|
||||
|
@ -201,9 +201,9 @@ fields:
|
||||
name: 'author',
|
||||
widget: 'relation',
|
||||
collection: 'authors',
|
||||
displayFields: [display_name],
|
||||
searchFields: [display_name],
|
||||
valueField: 'name',
|
||||
display_fields: [display_name],
|
||||
search_fields: [display_name],
|
||||
value_field: 'name',
|
||||
}
|
||||
- { label: 'Body', name: 'body', widget: 'markdown' }
|
||||
```
|
||||
|
@ -13,8 +13,8 @@ The date widget translates a date picker input to a date string. For saving date
|
||||
- **Options:**
|
||||
- `default`: accepts a date string, or an empty string to accept blank input; otherwise defaults to current date
|
||||
- `format`: optional; accepts Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/); defaults to raw Date object (if supported by output format)
|
||||
- `dateFormat`: optional; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format.
|
||||
- `timeFormat`: optional; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format, `false` hides time-picker. Defaults to false.
|
||||
- `date_format`: optional; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format.
|
||||
- `time_format`: optional; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format, `false` hides time-picker. Defaults to false.
|
||||
- **Example:**
|
||||
```yaml
|
||||
- label: 'Birthdate'
|
||||
|
@ -11,17 +11,17 @@ The datetime widget translates a datetime picker to a datetime string.
|
||||
- **Options:**
|
||||
- `default`: accepts a datetime string, or an empty string to accept blank input; otherwise defaults to current datetime
|
||||
- `format`: sets storage format; accepts Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/); defaults to raw Date object (if supported by output format)
|
||||
- `dateFormat`: sets date display format in UI; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format.
|
||||
- `timeFormat`: sets time display format in UI; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format, `false` hides time-picker.
|
||||
- `pickerUtc`: _(default: `false`)_ when set to `true`, the datetime picker will display times in UTC. When `false`, the datetime picker will display times in the user's local timezone. When using date-only formats, it can be helpful to set this to `true` so users in all timezones will see the same date in the datetime picker.
|
||||
- `date_format`: sets date display format in UI; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format.
|
||||
- `time_format`: sets time display format in UI; boolean or Moment.js [tokens](https://momentjs.com/docs/#/parsing/string-format/). If `true` use default locale format, `false` hides time-picker.
|
||||
- `picker_utc`: _(default: `false`)_ when set to `true`, the datetime picker will display times in UTC. When `false`, the datetime picker will display times in the user's local timezone. When using date-only formats, it can be helpful to set this to `true` so users in all timezones will see the same date in the datetime picker.
|
||||
- **Example:**
|
||||
```yaml
|
||||
- label: "Start time"
|
||||
name: "start"
|
||||
widget: "datetime"
|
||||
default: ""
|
||||
dateFormat: "DD.MM.YYYY" # e.g. 24.12.2021
|
||||
timeFormat: "HH:mm" # e.g. 21:07
|
||||
date_format: "DD.MM.YYYY" # e.g. 24.12.2021
|
||||
time_format: "HH:mm" # e.g. 21:07
|
||||
format: "LLL"
|
||||
pickerUtc: false
|
||||
picker_utc: false
|
||||
```
|
||||
|
@ -14,7 +14,7 @@ _Please note:_ If you want to use your markdown editor to fill a markdown file c
|
||||
- `default`: accepts markdown content
|
||||
- `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`.
|
||||
- `editorComponents`: an array of strings representing the names of editor components to display (all shown by default). The `image` and `code-block` editor components are included with Netlify CMS by default, but others may be [created and registered](/docs/custom-widgets/#registereditorcomponent).
|
||||
- `editor_components`: an array of strings representing the names of editor components to display (all shown by default). The `image` and `code-block` editor components are included with Netlify CMS by default, but others may be [created and registered](/docs/custom-widgets/#registereditorcomponent).
|
||||
- **Example:**
|
||||
|
||||
```yaml
|
||||
|
@ -7,10 +7,10 @@ The number widget uses an HTML number input, saving the value as a string, integ
|
||||
|
||||
- **Name:** `number`
|
||||
- **UI:** HTML [number input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number)
|
||||
- **Data type:** string by default; configured by `valueType` option
|
||||
- **Data type:** string by default; configured by `value_type` option
|
||||
- **Options:**
|
||||
- `default`: accepts string or number value; defaults to empty string
|
||||
- `valueType`: accepts `int` or `float`; any other value results in saving as a string
|
||||
- `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
|
||||
- `step`: accepts a number for stepping up/down values in the input; 1 by default
|
||||
@ -20,7 +20,7 @@ The number widget uses an HTML number input, saving the value as a string, integ
|
||||
name: "puppies"
|
||||
widget: "number"
|
||||
default: 2
|
||||
valueType: "int"
|
||||
value_type: "int"
|
||||
min: 1
|
||||
max: 101
|
||||
step: 2
|
||||
|
@ -10,13 +10,13 @@ The relation widget allows you to reference items from another collection. It pr
|
||||
- **Data type:** data type of the value pulled from the related collection item
|
||||
- **Options:**
|
||||
- `collection`: (**required**) name of the collection being referenced (string)
|
||||
- `valueField`: (**required**) name of the field from the referenced collection whose value will be stored for the relation. For nested fields, separate each subfield with a `.` (e.g. `name.first`). For list fields use a wildcard `*` to target all list items (e.g. `categories.*`).
|
||||
- `searchFields`: (**required**) list of one or more names of fields in the referenced collection to search for the typed value. Syntax to reference nested fields is similar to that of *valueField*.
|
||||
- `value_field`: (**required**) name of the field from the referenced collection whose value will be stored for the relation. For nested fields, separate each subfield with a `.` (e.g. `name.first`). For list fields use a wildcard `*` to target all list items (e.g. `categories.*`).
|
||||
- `search_fields`: (**required**) list of one or more names of fields in the referenced collection to search for the typed value. Syntax to reference nested fields is similar to that of *value_field*.
|
||||
- `file`: allows referencing a specific file when the collection being referenced is a files collection (string)
|
||||
- `displayFields`: list of one or more names of fields in the referenced collection that will render in the autocomplete menu of the control. Defaults to `valueField`. Syntax to reference nested fields is similar to that of *valueField*.
|
||||
- `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
|
||||
- `multiple` : accepts a boolean, defaults to `false`
|
||||
- `optionsLength`: accepts integer to override number of options presented to user. Defaults to `20`.
|
||||
- `options_length`: accepts integer to override number of options presented to user. Defaults to `20`.
|
||||
- **Referencing a folder collection example** (assuming a separate "authors" collection with "name" and "twitterHandle" fields with subfields "first" and "last" for the "name" field):
|
||||
|
||||
```yaml
|
||||
@ -24,9 +24,9 @@ The relation widget allows you to reference items from another collection. It pr
|
||||
name: "author"
|
||||
widget: "relation"
|
||||
collection: "authors"
|
||||
searchFields: ["name.first", "twitterHandle"]
|
||||
valueField: "name.first"
|
||||
displayFields: ["twitterHandle", "followerCount"]
|
||||
search_fields: ["name.first", "twitterHandle"]
|
||||
value_field: "name.first"
|
||||
display_fields: ["twitterHandle", "followerCount"]
|
||||
```
|
||||
|
||||
The generated UI input will search the authors collection by name and twitterHandle, and display each author's handle and follower count. On selection, the author name will be saved for the field.
|
||||
@ -38,9 +38,9 @@ The generated UI input will search the authors collection by name and twitterHan
|
||||
name: "author"
|
||||
widget: "relation"
|
||||
collection: "authors"
|
||||
searchFields: ['name.first']
|
||||
valueField: "{{slug}}"
|
||||
displayFields: ["{{twitterHandle}} - {{followerCount}}"]
|
||||
search_fields: ['name.first']
|
||||
value_field: "{{slug}}"
|
||||
display_fields: ["{{twitterHandle}} - {{followerCount}}"]
|
||||
```
|
||||
|
||||
The generated UI input will search the authors collection by name, and display each author's handle and follower count. On selection, the author entry slug will be saved for the field.
|
||||
@ -53,9 +53,9 @@ The generated UI input will search the authors collection by name, and display e
|
||||
widget: "relation"
|
||||
collection: "relation_files"
|
||||
file: "cities"
|
||||
searchFields: ["cities.*.name"]
|
||||
displayFields: ["cities.*.name"]
|
||||
valueField: "cities.*.id"
|
||||
search_fields: ["cities.*.name"]
|
||||
display_fields: ["cities.*.name"]
|
||||
value_field: "cities.*.id"
|
||||
```
|
||||
|
||||
The generated UI input will search the cities file by city name, and display each city's name. On selection, the city id will be saved for the field.
|
||||
|
Reference in New Issue
Block a user