Skip to content

Commit

Permalink
Add Grid repeater example (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
bennothommo authored Jul 12, 2024
1 parent e437586 commit ee85b44
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 1 deletion.
1 change: 1 addition & 0 deletions models/Record.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class Record extends Model
*/
protected $jsonable = [
'content',
'content_grid',
'additional_data',
];

Expand Down
24 changes: 24 additions & 0 deletions models/record/fields.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ secondaryTabs:
## Repeater
##
content:
label: Standard repeater
type: repeater
span: full
tab: Repeater
Expand All @@ -393,6 +394,29 @@ secondaryTabs:
type: textarea
span: full
size: huge
content_grid:
label: Grid repeater
type: repeater
mode: grid
columns: 4
rowHeight: 395
span: full
tab: Repeater
form:
fields:
image:
label: Image
type: mediafinder
mode: image
imageWidth: 300
imageHeight: 200
title:
label: Title
type: text
description:
label: Description
type: textarea
size: small

##
## Files
Expand Down
23 changes: 23 additions & 0 deletions updates/v2.1.1/add_content_grid_to_records.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

namespace Winter\Test\Updates;

use Schema;
use Winter\Storm\Database\Updates\Migration;

return new class extends Migration
{
public function up()
{
Schema::table('winter_test_records', function ($table) {
$table->mediumText('content_grid')->nullable()->after('content');
});
}

public function down()
{
Schema::table('winter_test_records', function ($table) {
$table->dropColumn('content_grid');
});
}
};
5 changes: 4 additions & 1 deletion updates/version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,7 @@
- v2.0.4/add_page_settings_columns.php
"2.1.0":
- "Add 'Records' section for testing of backend formwidgets"
- v2.1.0/create_records_table.php
- v2.1.0/create_records_table.php
"2.1.1":
- "Add example of Repeater Grid"
- v2.1.1/add_content_grid_to_records.php

0 comments on commit ee85b44

Please sign in to comment.