And it’s how it should be.
sidebar:
width: 1/3
# If you use the `sections` keyword, it means that what follows on the next indent level
# can only be sections (of type files, pages, info, fields).
sections:
# Each section needs a key
# filesfield and images_all are the names of the two sections (they are on the same indentation level
filesfield:
# Each section has properties
# The most important property of a section is the type
type: fields
# A fields section also needs to define its fields, this fields section only has one field, portfolio_list_image
fields:
portfolio_list_image:
label: Portfolio list image
type: files
required: true
# this is the second section, same indentation level as `filesfield`
images_all:
label: All images
type: files
If you indent images_all
so that it appears on the same indentation level as portfolio_list_image
, it becomes a field of the filesfield
section.
I said it before, yaml is a hierarchical file format, where the hierarchy of elements is important.
Each element can have certain subelements, e.g tabs can have columns but not the other way round. It’s like in HTML, where an element is only allowed to have certain other elements inside but not others. Or an element like img
has a list of allowed attributes (alt, src, etc.).