Default structure not working

Heya

I can’t get this to work - maybe it’s not implemented anymore?

emails:
    label: Emails
    type: structure
    default:
      - email: bastian@getkirby.com
      - email: lukas@getkirby.com
      - email: nico@getkirby.com
      - email: sonja@getkirby.com
    fields:
      email:
        label: Email
        type: email

tested on my version and on a fresh starterkit:

Or do I misunderstand what it should do?

Thanks! :slight_smile:

Did you try this with a new page or an existing one?

ah! existing page!
so this only works for new pages?

Yep! Let me know if it really does.

yes, on new pages it does :slight_smile:

just as an idea:
in the docs for textarea it says:

Sets the default text when a new page/file/user is created

whereas for structure it says:

Set the default rows for the structure

Would it not be better, to have structure say the same as textarea?

// edit: tried to do a PR for this page, but the content in question seems to not be editable by me…?

Much of what is in the Reference is auto-generated from comments in the source code, so you can’t make a PR. But why do you think the text should be changed. After all, you can define the content for multiple fields and multiple rows in a structure field, so that is not really the same.

but the part when a new page/file/user is created is the one I stumbled upon and you told me, this is the behaviour.
If it is exactly the same as for textfields, then it should be documented the same - at least that is what I am proposing. As for what value it is: the structure expects and array, where as textfield expects a string. which will be left unchanged.

Anyways, I now know how to use it - it was just a proposal on my side :slight_smile:

Ah, now I see what you were referring to, a misunderstanding. Looks like it’s almost the only field where that bit is missing. In any case, that behavior is true for all defaults of all fields.