table
A table block based on the structure field
Preview
The table block is a rather rudimentary block that is supposed to be fully implemented with a custom block blueprint and snippet.
Files
Blueprint
The default blueprint is really just a placeholder and looks like this:
For your custom table block blueprint, create a table.yml
file in /site/blueprints/blocks
. The table block is supposed to be used with a structure field called rows
. As regards the fields inside the structure, you are free to name them whatever you like.
In addition to this basic setup, you can also add additional fields that would allow users to add classes or ids to the block.
Snippet
The table block doesn’t come with a default snippet, but you have to create it yourself depending on the setup of your table blueprint.
If you don’t like the default preview, you can of course create your own preview as well.
Vue component
kirby/blob/main/panel/src/components/Forms/Blocks/Types/Table.vue