Nested fields in Hugo data files not working? #6865
-
Hello! Just got my first decapCMS running and I have run into an issue, I was using Forestry before and it was working fine. I have a layout in Hugo which uses a lot of nested fields in the data about.yml files. Example:
I want to access them like this using the yaml dot notation for nested fields:
And im figuring out it doesn't work with nested fields, the only solution is to make them not nested like company_enable, company_title... Also for the Logos example, im using a loop inside Hugo, so for each logo in partnerLogos do Anyone figured out if nested fields are possible at all in the data files so I dont have to rewrite my layout ? Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Instead of the dot notation, you have to use the object widget: https://decapcms.org/docs/widgets/object/ fields: [
{name: company, widget: object, fields: [
{name: enable, widget: boolean},
{name: title, widget: string},
{name: text, widget: text},
]},
{name: partnerLogos, widget: list, fields: [
{name: logo, widget: image},
{name: link, widget: string},
]}
] |
Beta Was this translation helpful? Give feedback.
Instead of the dot notation, you have to use the object widget: https://decapcms.org/docs/widgets/object/