Sorry, we don't support your browser.  Install a modern browser

Layout field: option to limit blocks to columns#297

Excluding blocks from certain column widths would simplfy block selection for clients.

3 years ago

This would be really useful - for example a Banner block should only be selectable for within a 1/1 column

3 years ago

Very usefull indeed

3 years ago

What would a syntax look like?

fields:
  layout:
    type: layout
    layouts:
      "1/1":
        1/1:
          limit: 1
          fieldsets: banner
      "1/3, 2/3":
        1/3:
          limit: 1
          fieldsets: image
        2/3:
          fieldsets:
            - heading
            - text
            - list

Current syntax without limit:

fields:
  layout:
    type: layout
    layouts:
      - "1/1"
      - "1/3, 2/3"
3 years ago
3

That looks good to me - readable and easy to understand

3 years ago
1

This is also related with: https://kirby.nolt.io/260

With my above syntax suggestion, each column setting so easier.

3 years ago

Just wanted to leave this here: https://github.com/rasteiner/conditionalblocks

fields:
  layout:
    type: layout
    layouts:
      - "1/1"
      - "1/2, 1/4, 1/4"
      - "1/6, 5/6"

    requires:
      min:
        1/3:
          - image
          - video
          - code
      max:
        1/2: text

    fieldsets:
      - text
      - image
      - video
      - code
3 years ago
2

That looks great - I will be testing this tomorrow on a new build :)

3 years ago