Block elements depending on layout selection

Hi!

I have several block elements (e.g. “myHero”, “myDishes”, …) listed in “fieldsets” and they all are available within every defined layout (e.g. “1/1” and “1/2, 1/2”). The definition looks like this:

layouts:
   - "1/1"
   - "1/2, 1/2"
   - "1/3, 1/3, 1/3"
fieldsets:
   - myHeading
   - myText
   - myImage
   - myHero
   - myDishes

Is there a way that certain block elements, for example “myHero”, can only be selected within particular layouts, let’s say “1/1” (and not within “1/2, 1/2” and “1/3, 1/3, 1/3”)?

Thanks for hints (-:

No, this is currently not possible.

A workaround could be to nest layouts in blocks.

Thanks for the super fast response!

Is there a recipe for nesting layouts in blocks? I found this ticket (Unable to nest layout fields, error 500 in the panel) and this plugin (GitHub - youngcut/kirby-grid-block). Which is more useful?

Thanks (-:

I think the advantage of the plugin is that you get the preview for free.

The error described in the issue popped up yesterday, I haven’t been able to reproduce it yet.

is this still not possible?
is there a better workaround than nesting blocks into layouts?

No, but there is a feature request to upvote if you haven’t yet. https://kirby.nolt.io/297

There is a plugin, but only Kirby 3: GitHub - rasteiner/conditionalblocks: Kirby 3 plugin: disables blocks in layout fields when the column width does not match the block requirements

Upvoted, thanks!

Upvoted, thanks :slight_smile: