Using the textarea in fieldsets / layouts

Hey,

I’m trying to use the “large textarea with buttons” which I can define in fields in a blueprint which uses layouts. As far as I can see, the layout only accepts fieldsets, which in turn doesn’t know the textarea, only the single line “text” fieldset.

I’d like to extend this blueprint with the layout component. It looks like I can’t combine sections and layout either, but that’s fine.

columns:
  main:
    width: 2/3
    sections:
      fields:
        type: fields
        fields:
          banner:
            type: files
            label: Banner
            multiple: false
          text:
            type: textarea
            size: huge
          media:
            type: blocks
            size: huge
            fieldsets:
              - maps
              - text
              - image
              - gallery
              - heading

I’d like to achieve something like this:

columns:
  main:
    width: 2/3
    fields:
      layout:
        type: layout
        layouts:
          - "1/1"
          - "1/2, 1/2"
          - "1/4, 1/4, 1/4, 1/4"
          - "1/1, 1/3, 2/3"
          - "1/1, 2/3, 1/3"
          - "1/2, 1/2, 1/3, 1/3, 1/3"
        fieldsets:
          - maps
          - image
          - gallery
          - heading
          # wishful thinking starts here
          - text:
              label: text
              type: textarea

Is this possible to achieve by default and I’m just bad with yml or do I need to extend something?

Thanks for your help!

There is already a block type markdown which uses the textarea field internally, you can extend that to enable the button which are by default disabled.

You can do that by extending: Modifying blocks types and custom blocks | Kirby CMS

Thanks! Here’s how I ended up doing it - maybe its possible without pseudo-extending the other blocks?

columns:
  main:
    width: 2/3
    fields:
      layout:
        type: layout
        label: Inhalt
        layouts:
          - "1/1"
          - "1/2, 1/2"
          - "1/4, 1/4, 1/4, 1/4"
          - "1/3, 2/3"
          - "2/3, 1/3"
          - "1/3, 1/3, 1/3"
        fieldsets:
          text:
            extends: blocks/markdown
            placeholder: text
            preview: text
            name: Text
            icon: text
            fields:
              text:
                type: textarea
                buttons: true
          image:
            extends: blocks/image
          gallery:
            extends: blocks/gallery
          heading:
            extends: blocks/heading
          maps:
            extends: blocks/maps

Yes, you can just list them, no need to extend each and every one of them. But if I were you and because I like clean blueprints, I would create a new blueprints/blocks/text.yml blueprint for it.

fieldsets:
  text:
  extends: blocks/markdown
  placeholder: text
  preview: text
  name: Text
  icon: text
  fields:
    text:
      type: textarea
      buttons: true
    - image:
    - gallery:
    - heading:
    - maps:

I don’t think it’s a good idea to overwrite the text block type with a markdown field, unless you don’t want to use the original text block anywhere else. Also, if you do this, you will have to overwrite the snippet that outputs the text block.