Skip to content

Commit 5485853

Browse files
chore: initial commit
0 parents  commit 5485853

File tree

15 files changed

+5017
-0
lines changed

15 files changed

+5017
-0
lines changed

.editorconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*]
2+
charset = utf-8
3+
indent_style = space
4+
indent_size = 2
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true

.gitattributes

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Git
2+
.gitattributes export-ignore
3+
.github/ export-ignore
4+
.gitignore export-ignore
5+
6+
# Source files
7+
src/ export-ignore
8+
9+
# Development files
10+
.editorconfig export-ignore
11+
composer.lock export-ignore
12+
package-lock.json export-ignore
13+
package.json export-ignore

.github/preview.png

403 KB
Loading

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# OS files
2+
.DS_Store
3+
4+
# Development files
5+
/node_modules
6+
/vendor
7+
8+
# Temporary files
9+
index.dev.mjs

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 Bogdan Condorachi
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
![Kirby Table Field](./.github/preview.png)
2+
3+
# Kirby Table Field
4+
The table field streamlines the management of structured data in tables, offering a user-friendly interface that simplifies data entry and enhances content creation by making tabular information effortlessly manageable.
5+
6+
> [!NOTE]
7+
> This plugin only supports Kirby 4. If you are still using Kirby 3, we recommend the previous [table-field](https://github.com/ragi96/table-field) plugin.
8+
9+
## Installation
10+
11+
### Composer
12+
13+
```bash
14+
composer require bogdancondorachi/kirby-table-field
15+
```
16+
17+
### Download
18+
19+
Download and copy this repository to `/site/plugins/kirby-table-field`.
20+
21+
## Usage
22+
23+
#### Add the field to your blueprint:
24+
```yaml
25+
fields:
26+
table:
27+
label: table
28+
type: table
29+
# optional, default values
30+
minColumns: 2
31+
maxColumns: 5
32+
```
33+
34+
#### Use the field in your template:
35+
```php
36+
<?php $table = $page->table()->toTable(); ?>
37+
<?php if($table != null): ?>
38+
<table>
39+
<thead>
40+
<tr>
41+
<?php foreach ($table['headers'] as $header): ?>
42+
<th><?= $header ?></th>
43+
<?php endforeach ?>
44+
</tr>
45+
</thead>
46+
<tbody>
47+
<?php foreach ($table['rows'] as $row): ?>
48+
<tr>
49+
<?php foreach ($row as $cell): ?>
50+
<td><?= $cell ?></td>
51+
<?php endforeach ?>
52+
</tr>
53+
<?php endforeach ?>
54+
</tbody>
55+
</table>
56+
<?php endif ?>
57+
```
58+
59+
## Credits
60+
61+
- [Rafael Giezendanner](https://github.com/ragi96) for the initial [table-field](https://github.com/ragi96/table-field) plugin.
62+
63+
## License
64+
65+
[MIT License](./LICENSE)
66+
Copyright © 2024
67+
[Bogdan Condorachi](https://github.com/bogdancondorachi)

composer.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "bogdancondorachi/kirby-table-field",
3+
"description": "Table field plugin for Kirby CMS",
4+
"type": "kirby-plugin",
5+
"version": "2.0.0",
6+
"license": "MIT",
7+
"authors": [
8+
{
9+
"name": "Bogdan Condorachi",
10+
"email": "[email protected]"
11+
}
12+
],
13+
"require": {
14+
"getkirby/composer-installer": "^1.2"
15+
},
16+
"require-dev": {
17+
"getkirby/cms": "^4.0"
18+
},
19+
"scripts": {
20+
"dist": "composer install --no-dev --optimize-autoloader"
21+
},
22+
"config": {
23+
"optimize-autoloader": true,
24+
"allow-plugins": {
25+
"getkirby/composer-installer": true
26+
}
27+
},
28+
"extra": {
29+
"kirby-cms-path": false
30+
}
31+
}

0 commit comments

Comments
 (0)