Default values for layout field

Hi,

i am wondering if (and how) it is possible to set default values for a layout field.

My current blueprint looks like:

fields:
  title:
    type: text
    default: Gallerie
  grid:
    type: layout
    pretty: true
    when:
      - false
    layouts:
      - "1/2, 1/2"
      - "1/3, 1/3, 1/3"
      - "1/4, 1/4, 1/4, 1/4"
    fieldsets:
      - image
      - audio
      - videodr

By default i’d like to initially set the 4/4 layout which (ideally) has all 4 blocks prefilled with image blocks.

Any idea how to achieve that?

Best, Thomas E.-E.

While you can set default values, that doesn’t work with multi-column layouts: Default blocks in a layout - #2 by thguenther

Therefore I’d suggest to use a page.create:after hook to populate the layout field on page creation.

Although your image blocks would remain empty because the page doesn’t have images at page creation…