From 6a0021c5ad4c0c8c2eba6413297e2fd097baa535 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Fri, 6 Dec 2024 15:30:05 +0000 Subject: [PATCH] Table: Add Max Columns & Max Rows config options --- resources/lang/en/fieldtypes.php | 2 ++ src/Fieldtypes/Table.php | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/resources/lang/en/fieldtypes.php b/resources/lang/en/fieldtypes.php index 7b0e375665..f493e2394d 100644 --- a/resources/lang/en/fieldtypes.php +++ b/resources/lang/en/fieldtypes.php @@ -169,6 +169,8 @@ 'slug.config.show_regenerate' => 'Show the regenerate button to re-slugify from the target field.', 'slug.title' => 'Slug', 'structures.title' => 'Structures', + 'table.config.max_columns' => 'Set a maximum number of columns.', + 'table.config.max_rows' => 'Set a maximum number of rows.', 'table.title' => 'Table', 'taggable.config.options' => 'Provide pre-defined tags that can be selected.', 'taggable.config.placeholder' => 'Type and press ↩ Enter', diff --git a/src/Fieldtypes/Table.php b/src/Fieldtypes/Table.php index bf235cc516..8c1719c95a 100644 --- a/src/Fieldtypes/Table.php +++ b/src/Fieldtypes/Table.php @@ -18,6 +18,16 @@ protected function configFieldItems(): array 'instructions' => __('statamic::messages.fields_default_instructions'), 'type' => 'table', ], + 'max_rows' => [ + 'display' => __('Max Columns'), + 'instructions' => __('statamic::fieldtypes.table.config.max_rows'), + 'type' => 'integer', + ], + 'max_columns' => [ + 'display' => __('Max Columns'), + 'instructions' => __('statamic::fieldtypes.table.config.max_columns'), + 'type' => 'integer', + ], ]; }