Using templates, how to create sub-keys in the page frontmatter?

I’m trying to create a blueprint for a form that will result in a frontmatter with an additional level. Let’s say this is what the result should look like:

object:
    color: blue
    width: 340

How would I go about this in the blueprint? I’ve only managed to get this to work by using a section to introduce the object key before being able to actually use the sub-keys, object.color and object.width:

fields:
    header.object:
        name: object
        type: section
        title: Object

        fields:
            header.object.color:
                name: color
                type: text
                label: Color

            header.object.width:
                name: width
                type: number
                label: Width

Omitting the first block (the section definition) leads to the form showing up empty. What if I don’t want a section element and the title that comes with it? Is there another way to tell the blueprint: “Let’s now deal with sub-keys of the object key”?

@domsson The following definition for fields in your blueprints/default.yaml will produce what you want:

[form + tab definitions omited]
fields:
  header.object.color:
    name: color
    type: text
    label: Color

  header.object.width:
    name: width
    type: number
    label: Width

It generates the following frontmatter:

object:
    color: blue
    width: 340

Hope this helps.

Well, this is slightly embarrassing. I tried that exact thing several times, and every time I did, the tab would not show up in the admin. After your reply, I tried one more time and guess what? It worked. Maybe I messed up the indentation when I previously tried. In any case, thanks for your working example, my issue turned out to be a non-issue. :slight_smile: