committed by
GitHub
parent
ba1cde4e01
commit
c55d1f912f
@ -6,7 +6,7 @@ weight: 0
|
||||
|
||||
Widgets define the data type and interface for entry fields. Static CMS comes with several built-in widgets. Click the widget names in the sidebar to jump to specific widget details. You can also [create your own](/docs/custom-widgets)!
|
||||
|
||||
Widgets are specified as collection fields in the Static CMS `config.yml` file. Note that [YAML syntax](https://en.wikipedia.org/wiki/YAML#Basic_components) allows lists and objects to be written in block or inline style, and the code samples below include a mix of both.
|
||||
Widgets are specified as collection fields in the Static CMS `config` file. Note that [YAML syntax](https://en.wikipedia.org/wiki/YAML#Basic_components) allows lists and objects to be written in block or inline style, and the code samples below include a mix of both.
|
||||
|
||||
To see working examples of all of the built-in widgets, try making a 'Kitchen Sink' collection item on the [CMS demo site](https://static-static-cms-demo.netlify.app). (No login required: click the login button and the CMS will open.) You can refer to the demo [configuration code](https://github.com/StaticJsCMS/static-cms/blob/main/dev-test/config.yml) to see how each field was configured.
|
||||
|
||||
@ -48,9 +48,19 @@ The following options are available on all fields:
|
||||
|
||||
### Example
|
||||
|
||||
<CodeTabs>
|
||||
```yaml
|
||||
name: title
|
||||
label: Title
|
||||
widget: string
|
||||
pattern: ['.{12,}', 'Must have at least 12 characters']
|
||||
```
|
||||
|
||||
```js
|
||||
name: 'title',
|
||||
label: 'Title',
|
||||
widget: 'string',
|
||||
pattern: ['.{12,}', 'Must have at least 12 characters'],
|
||||
```
|
||||
|
||||
</CodeTabs>
|
||||
|
Reference in New Issue
Block a user