decaporg / decap-cms

A Git-based CMS for Static Site Generators
https://decapcms.org
MIT License
17.84k stars 3.04k forks source link

Any kind of list or modular component nested inside the existing modular components widget #6060

Open mcdowellalex opened 2 years ago

mcdowellalex commented 2 years ago

So having a widget that allows modular components (what we have here https://github.com/netlify/netlify-cms/pull/1857) is really nice. But it doesn't seem all that useful to me unless I can nest another modular component block or a list widget inside of that.

As of right now, if you try and nest a list or modular components widget inside, there is no ability to "create new" data. The parameter of "create:true" doesn't seem to be working.

Ideally, it would be nice to be able to do something like this in the config.yml:


      name: contentBlocks
      widget: list
      types:
        - label: Nested Modular Component
          name: nestedModularComponent
          widget: list
          types:
            - {label: lorem, name: ipsum, widget: string}
        - label: Nested List
           name: nestedList
           widget: list
           create: true
           fields:
             - {label: lorem, name: ipsum, widget: string}```
ui-jb commented 3 months ago

This is still an issue, unfortunately. I tried getting around this using a relation field, but that results in the following error:

image

EDIT: I found a workaround! You just need to wrap your list in an object. As long as a list isn't a direct descendant of types, you can use a list 😄