Cascade Layout-Fields

Is there a way to cascade layouts?

I tried something like this:

//blueprint/pages/default.yml
content:
  type: layout
  fieldsets:
    - grid

And i also made a block:

//blueprint/blocks/grid.yml
fields:
  grid:
    type: layout
    layouts:
      - "1/1"
      - "1/2, 1/2"
      - "1/3, 1/3, 1/3"

Works well but i can’t get preview:


Any Ideas or any other workarounds?

The benefit of that is: You could put a wrapper around the layout. Make sense on One-Pagers, where you have multiple sections and inside a layout with multiple rows.

You grid is a new block type, and you would have to create a preview for it: Blocks | Kirby CMS

I think the way forward would be via a custom endpoint in your preview that returns the rendered layout.

Thanks Sonja. Would you thing, there is a way to inherit the preview from the existing Layout-Field?

I made a suggestion for this. Upvote here

Howdy! :cowboy_hat_face:
I made a Plugin for this!
The GRID-BLOCK-PLUGIN, available now for all.

2 Likes

Hi there. The plugin i mention here before is deprecated. Please use the Kirby Column Block.