https://github.com/kbravh/netlify-cms-widget-nested-select
A widget for Netlify CMS that will conditionally show a second select with its own options based on what's chosen in the first select. This can be used, for example, to set up subcategories inside of categories.
https://github.com/kbravh/netlify-cms-widget-nested-select
netlify-cms
Last synced: about 2 months ago
JSON representation
A widget for Netlify CMS that will conditionally show a second select with its own options based on what's chosen in the first select. This can be used, for example, to set up subcategories inside of categories.
- Host: GitHub
- URL: https://github.com/kbravh/netlify-cms-widget-nested-select
- Owner: kbravh
- License: mit
- Created: 2019-10-15T01:55:29.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-29T16:13:10.000Z (8 months ago)
- Last Synced: 2025-04-26T16:10:09.702Z (2 months ago)
- Topics: netlify-cms
- Language: JavaScript
- Homepage:
- Size: 2.34 MB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-decap-cms - netlify-cms-widget-nested-select - A widget for Netlify CMS that will conditionally show a second select with its own options based on what's chosen in the first select. (Custom Widget)
README
# netlify-cms-widget-nested-select
[Check out a demo!](https://netlify-cms-widget-nested-select.netlify.app)
This widget will conditionally show a second select with its own options based on what's chosen in the first select. This can be used, for example, to set up subcategories inside of categories.
## Install
As an npm package:
```shell
npm install --save netlify-cms-widget-nested-select
``````js
import {NestedSelectControl, NestedSelectPreview} from 'netlify-cms-widget-nested-select'CMS.registerWidget('nested-select', NestedSelectControl, NestedSelectPreview)
```Via `script` tag:
```html
CMS.registerWidget('nested-select', NestedSelectControl, NestedSelectPreview)
```
## How to use
Add to your Netlify CMS configuration:
```yaml
fields:
- {
name: ,
label: ,
widget: nested-select,
options: [
"Regular option",
"Another regular option",
{
label: "Option with suboptions",
options: [
"Suboption 1",
"Suboption 2",
"Suboption 3"
]
}
]
}
```## Support
For help with this widget, open an [issue](https://github.com/kbravh/netlify-cms-widget-nested-select/issues).