Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2
📈 Table field/block plugin for Kirby CMS
License
bogdancondorachi/kirby-table-field
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Note
This flexible yet powerful panel field is designed to effortlessly manage and display large datasets. It enables users to dynamically add, edit, and organize data in rows and columns, offering intuitive controls for adding, removing, duplicating, and rearranging entries. Ideal for handling complex data structures while ensuring a clean and user-friendly interface.
composer require bogdancondorachi/kirby-table-field
git submodule add https://github.com/bogdancondorachi/kirby-table-field.git site/plugins/table-field
Download and extract the folder to/site/plugins/table-field
fields:table:label:Tabletype:table# optional (see field properties)
Name | Type | Default | Description |
---|---|---|---|
align | string | - | Set the text alignment of the table |
disabled | bool | - | Iftrue , the field is no longer editable and will not be saved |
duplicate | bool | true | Toggles duplicating columns and rows in the table |
empty | string | - | The placeholder text if no rows exists |
help | string | - | Optional help text below the field |
index | int ,bool | 1 | Specifies the starting index. If set tofalse , it removes the index column; in this case,sortable would be disabled as well |
label | string | - | Set the label above the field |
marks | bool ,array | true | Set the allowed HTML formats. Activate/deactivate them all by passingtrue /false |
maxColumns | int | 8 | Set the maximum allowed columns in the table |
minColumns | int | 2 | Set the minimum required columns in the table |
sortable | bool | true | Toggles drag & drop sorting |
translate | bool | true | Iffalse , the field will be disabled in non-default languages and cannot be translated. This is only relevant in multi-language setups. |
<?php$table =$page->table()->toTable();if (!empty($table['headers']) && !empty($table['rows'])):?> <table> <thead> <tr><?phpforeach ($table['headers']as$header):?> <th><?=$header?></th><?phpendforeach?> </tr> </thead> <tbody><?phpforeach ($table['rows']as$row):?> <tr><?phpforeach ($rowas$cell):?> <td><?=$cell?></td><?phpendforeach?> </tr><?phpendforeach?> </tbody> </table><?phpendif?>
fields:text:type:blocksfieldsets: -table
name:Tableicon:tablepreview:dataTablefields:table:type:tablecaption:type:writericon:textinline:true
To overwrite the default blueprint, place your custom file in/site/blueprints/blocks/table.yml
<?php$table =$block->table()->toTable();if (!empty($table['headers']) && !empty($table['rows'])):?> <table> <thead> <tr><?phpforeach ($table['headers']as$header):?> <th><?=$header?></th><?phpendforeach?> </tr> </thead> <tbody><?phpforeach ($table['rows']as$row):?> <tr><?phpforeach ($rowas$cell):?> <td><?=$cell?></td><?phpendforeach?> </tr><?phpendforeach?> </tbody> </table><?phpendif?>
To overwrite this default snippet, place your custom file in/site/snippets/blocks/table.php
Note
This plugin is provided free of charge & published under the permissive MIT License. If you're using it for a commercial project or just want to help keep it alive, please considerdonating. Your support fuels future development!
MIT License Copyright © 2024Bogdan Condorachi
About
📈 Table field/block plugin for Kirby CMS
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.