From 5e13c55f2799a65c4e47316ebb35ebeb4391a2c7 Mon Sep 17 00:00:00 2001 From: Jason Irish Date: Wed, 3 Sep 2025 11:45:54 -0500 Subject: [PATCH 1/2] Implement TextCheckboxGroupField for consistent Title field pattern - Add TextCheckboxGroupField import and implementation in Slide::getCMSFields() - Match BaseElementObject Title field pattern for consistency - Remove ShowTitle from removeByName array (handled by TextCheckboxGroupField) - Add fallback for when TextCheckboxGroupField class doesn't exist - Ensures consistent Title/ShowTitle behavior across BaseElementObject descendants Aligns with TopTitle consolidation in essentials-tools CustomStylesExtension. --- src/Model/Slide.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Model/Slide.php b/src/Model/Slide.php index cb1dbc0..ded0292 100644 --- a/src/Model/Slide.php +++ b/src/Model/Slide.php @@ -119,7 +119,8 @@ public function getCMSFields(): FieldList if (class_exists(TextCheckboxGroupField::class)) { $fields->replaceField( 'Title', - TextCheckboxGroupField::create('Title') + TextCheckboxGroupField::create() + ->setName('Title') ->setTitle($this->fieldLabel('Title')) ); } else { From cc167e5393ca258b7bda071791e74ed542ce4e8d Mon Sep 17 00:00:00 2001 From: Jason Irish Date: Wed, 3 Sep 2025 12:07:40 -0500 Subject: [PATCH 2/2] Update Slide to use natural TitleShowTitle field naming - Use TextCheckboxGroupField::create('Title') instead of ->setName('Title') - This creates 'TitleShowTitle' field name naturally - Matches BaseElementObject pattern for consistency - Part of unified approach across all BaseElementObject descendants --- src/Model/Slide.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Model/Slide.php b/src/Model/Slide.php index ded0292..cb1dbc0 100644 --- a/src/Model/Slide.php +++ b/src/Model/Slide.php @@ -119,8 +119,7 @@ public function getCMSFields(): FieldList if (class_exists(TextCheckboxGroupField::class)) { $fields->replaceField( 'Title', - TextCheckboxGroupField::create() - ->setName('Title') + TextCheckboxGroupField::create('Title') ->setTitle($this->fieldLabel('Title')) ); } else {