Skip to content

Commit

Permalink
Add UI for listing field sortable config
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanmitchell committed Jun 4, 2024
1 parent 588a1ed commit 21dd47c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/lang/en/messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
'fields_instructions_instructions' => 'Provide additional field instructions like this very text. Markdown formatting is supported.',
'fields_instructions_position_instructions' => 'Show instructions above or below the field.',
'fields_listable_instructions' => 'Control the listing column visibility.',
'fields_sortable_instructions' => 'Control if the field should be sortable in listing views.',
'fields_visibility_instructions' => 'Control field visibility on publish forms.',
'fields_replicator_preview_instructions' => 'Control preview visibility in Replicator/Bard sets.',
'fieldset_import_fieldset_instructions' => 'The fieldset to be imported.',
Expand Down
10 changes: 10 additions & 0 deletions src/Fields/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,16 @@ public static function commonFieldOptions(): Fields
'type' => 'section',
],
],
'sortable' => [
'display' => __('Sortable'),
'instructions' => __('statamic::messages.fields_sortable_instructions'),
'type' => 'toggle',
'default' => true,
'if' => [
'listable' => 'not hidden',
'visibility' => 'not computed',
],
],
'visibility' => [
'display' => __('Visibility'),
'instructions' => __('statamic::messages.fields_visibility_instructions'),
Expand Down

0 comments on commit 21dd47c

Please sign in to comment.