decaporg / decaporg/decap-cms

Recursive Variable List Widgets

Open
#2,694 5 comments 4 reactions 0 assignees View on GitHub
area: extensions/widgets/list kind: question pinned
Dominant language
JavaScript
Stars
19.4k
Forks
3.1k
Avg merge
1d 14h
Merged PRs (30d)
9

Description

**Is your feature request related to a problem? Please describe.**
I'm experimenting with creating a page builder in Netlify CMS, and the variable type list widget already does wonders for that!

Now somewhere in the config I want to have a variable list widget, where one of it's types is the widget itself, recursively. For this widget I'm rendering a `` component in React, which takes `children` of any type, including another ``.

**Describe the solution you'd like**
I would like to be able to nest as many of these widgets recursively in the Netlify CMS UI as I want, until I end with a component that doesn't take children (or least not recursively).

**Additional context**
Of course trying to define this in a Netlify CMS `config.yaml` or `.json` isn't possible. I would love to work on a PR to make this possible, but decided to post this feature request first to see if there has been any thought about this already (I would think there is!), if it's feasible and desirable at all!

I guess to make it work there would have to be some kind of referencing in the yaml or config, e.g:

```
- label: "Box"
model: "Box"
name: "box"
widget: "list"
types:
- {label: Anything, name: anything, widget: string, default: "Text"}
- {modelReference: "Box"}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.