decap-cms
decap-cms copied to clipboard
Recursive Variable List Widgets
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 <Box /> component in React, which takes children of any type, including another <Box />.
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"}
Hi @RobertBroersma ... have you tried to implement this? I think it's very desirable and I wonder that nobody still wants this feature :-)
Hi @bauer01
I haven't tried. I haven't been using a lot of CMS-es lately 😅
If you're looking for a CMS for page-building you could check out the blocks feature of TinaCMS: https://tinacms.org/ I haven't tried it yet myself but it seems to do what I describe in this issue :)
This can be achieved with variable type widgets, so I'm closing as done
@martinjagodic I don't see how variable type widgets supports the feature requested here. The documentation does not mention anything about support for recursive types. Could you clarify or supply an example?
You are right, I was too fast when batch-closing issues the other day. Sorry!