fixes #6812
code widgets now shows content if it's inside list.
Test plan
config.yml
local_backend: true
backend:
name: proxy
proxy_url: http://localhost:8082/api/v1
branch: main
# These lines should *not* be indented
media_folder: "static/img" # Media files will be stored in the repo under static/images/uploads
public_folder: "/img/" # The src attribute for uploaded media will begin with /images/uploads
collections:
- name: docs
label: Docs
label_singular: "Doc"
folder: "docs"
path: "{{title}}/{{id}}"
slug: "{{id}}"
create: true
nested: { depth: 100 } # accepts an optional summary template
allow_nesting: true
meta: { path: { widget: string, label: "Path", index_file: "index" } }
fields:
- { label: "title", name: "title", widget: "string" }
- {
name: "code test",
label: "Example Code",
widget: "code",
default_language: "jsx",
output_code_only: true,
hint: "Add or choose a file with valid React or MUI code. This will render the preview area of the example. Specify imports as needed in your file.",
}
- {
name: "items",
label: "Examples",
widget: "list",
fields: [
{
name: "name",
label: "Name",
widget: "string",
hint: "This is used to label the example in the admin area. It does not show on the website.",
},
{
name: "type",
label: "Type",
widget: "select",
options: [
{
label: "Theme Preview",
value: "",
},
{
label: "Do (Success)",
value: "success",
},
{
label: "Don't (Error)",
value: "error",
},
],
},
{
name: "code",
label: "Example Code",
widget: "code",
default_language: "jsx",
output_code_only: true,
hint: "Add or choose a file with valid React or MUI code. This will render the preview area of the example. Specify imports as needed in your file.",
},
{
name: "description",
label: "Description",
widget: "text",
hint: "Use this area to provide notes and context about this example. Line breaks and code are not supported and will be removed on save.\n ⚠",
},
{
name: "items inside",
label: "Examples inside",
widget: "list",
fields: [
{
name: "name",
label: "Name",
widget: "string",
hint: "This is used to label the example in the admin area. It does not show on the website.",
},
{
name: "type",
label: "Type",
widget: "select",
options: [
{
label: "Theme Preview",
value: "",
},
{
label: "Do (Success)",
value: "success",
},
{
label: "Don't (Error)",
value: "error",
},
],
},
{
name: "code",
label: "Example Code",
widget: "code",
default_language: "jsx",
output_code_only: true,
hint: "Add or choose a file with valid React or MUI code. This will render the preview area of the example. Specify imports as needed in your file.",
},
{
name: "description",
label: "Description",
widget: "text",
hint: "Use this area to provide notes and context about this example. Line breaks and code are not supported and will be removed on save.\n ⚠",
},
]
}
]
}
Summary
fixes #6812 code widgets now shows content if it's inside list.
Test plan
config.yml
Before:![image](https://github.com/decaporg/decap-cms/assets/10455862/19de5084-7606-4032-b8be-282cc5ec228c)
After:![image](https://github.com/decaporg/decap-cms/assets/10455862/2f8f7747-49a2-4cb5-aca8-c93f6ad55954)
Checklist
Please add a
x
inside each checkbox:A picture of a cute animal (not mandatory but encouraged)![image](https://github.com/decaporg/decap-cms/assets/10455862/71796571-08a4-4f8b-9536-9c069fea264c)