Adding custom blocks to the "select a block" menu in the StarterKit

I’m trying out Kirby with the StarterKit, and wanted to use the Table plugin for the About us page. The About us page lets you add blocks, so I wanted “Table” to be an option in the popup blocks menu. I’ve installed the plugin as per the instructions except I’m stuck on this step “Add the block to your blueprint.” The YAML given is:
fields:
text:
type: blocks
fieldsets:
- table

I’m guessing I need to put this in /site/blueprints/pages/about.yml. Some sources online say it needs to go in /site/default/pages/default.yml. Anyway, I tried putting it in both, but can’t get the custom block to appear as an option with the other blocks when you click the “+” sign.

For example, about.yml has:
tabs:
content:
icon: text
label: Content
fields:
layout:
label: Layout
type: layout
layouts:
- “1/1”
- “1/2, 1/2”
- “1/3, 1/3, 1/3”

So I added some code for blocks as suggested:
tabs:
content:
icon: text
label: Content
fields:
layout:
label: Layout
type: layout
layouts:
- “1/1”
- “1/2, 1/2”
- “1/3, 1/3, 1/3”
text:
type: blocks
fieldsets:
- heading
- text
- list
- table

I’ve tried playing with indents and even pulling another fields array out by itself:
fields:
text:
type: blocks
fieldsets:
- heading
- text
- list
- table

The best I can do is get a separate panel in the editing screen where I can insert a table (so the Table plugin seems to be working). I don’t want that. I just want “Table” to be a block option in the existing panels. Does anyone know how I achieve that?

I’m guessing I’ve got the wrong nesting in the YAML, but I am unable to discover what the right nesting would be.
The custom blocks tutorial seems to assume your blueprint file is empty, and the AI answers says “Find the type: blocks section of your blueprint file”, but I can’t find a type: blocks section in the StarterKit blueprints.

Did you create the file /site/blueprints/blocks/table.yml as is described in the readme of the plugin?

Thanks for the reply! Yes, I did. I also created the snippet in /site/snippets/blocks/table.php. So basically I followed the instruction under Block usage. I just wasn’t sure where to put the YAML under “Add the block to your blueprint:”. I can get the YAML to create a separate text panel below the main textarea and insert a table there, so the Table plugin seems to be working in some fashion. I just can’t get “Table” to show as an option for the main textarea.

Hm, works for me.

I created table.yml in site/blueprints/blocks/ with the following content from the readme:

name: Table
icon: table
preview: dataTable
fields:
  table:
    type: table
  caption:
    type: writer
    icon: text
    inline: true

In about.yml, I added a new blocks field above the existing layout field, so that about.yml now looks like this (removed all comments)

title: About us
icon: ☎️

status:
  draft: true
  listed: true

options:
  changeSlug: false
  delete: false

tabs:
  content:
    icon: text
    label: Content
    fields:
      text:
        type: blocks
        fieldsets:
          # add block types as needed
          - table
          - text
          - headline
      layout:
        label: Layout
        type: layout
        layouts:
          - "1/1"
          - "1/2, 1/2"
          - "1/3, 1/3, 1/3"
  contact:
    icon: map
    label: Contact
    columns:
      - width: 1/2
        fields:
          address:
            label: Address
            type: writer
            inline: true
          email:
            label: Email
            type: email
          phone:
            label: Phone
            type: tel
      - width: 1/2
        fields:
          social:
            label: On the web
            type: structure
            columns:
              platform: true
            fields:
              platform:
                label: Platform
                type: text
                width: 1/2
              url:
                label: URL
                type: url
                width: 1/2

When hitting the + button to add a new block to the field, I now get the table block as option:

Thanks. Yes, that works for me, but I wanted to put a table in the area labelled “Layout” (see where the red arrow is pointing in the first screenshot). Imagine I’m a non-technical editor, and the “Layout” area shows me the components of the page. I want to add a table at the bottom of the page, so I click the plus sign at the bottom of the page and the “Select a layout” dialogue shows. I choose a blank row (no columns) then want to insert a table in that row, but there is no table option in the “Choose a block” dialogue, just the default blocks. Is there any way to give them the table option?

Sorry - perhaps I’m completely misunderstanding how Kirby works!

Then you have to add that block to the available blocks in the layout field, works the same way as adding it to a blocks field, by setting the fieldsets property, see docs: Layout | Kirby CMS

Yes, that’s it! Thanks a lot! All the examples I’d seen had blocks in a “fields” array in the YAML so I assumed I had to do that somehow. I didn’t know you could make “fieldsets” a direct descendant of “layout”. I’ll have to read up more about it. Thanks for your help.