Update Slide to use natural TitleShowTitle field naming#40
Closed
jsirish wants to merge 2 commits into
Closed
Conversation
- 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.
There was a problem hiding this comment.
Pull Request Overview
This PR standardizes the Title field implementation in the Slide class to match the pattern used in BaseElementObject descendants, ensuring consistent CMS behavior and compatibility with TopTitle functionality from the CustomStylesExtension.
- Fixes TextCheckboxGroupField instantiation to use proper fluent interface pattern
- Ensures consistent Title/ShowTitle field behavior across all BaseElementObject descendants
- Enables TopTitle field positioning to work correctly via CustomStylesExtension
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
- 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Updates the Slide class to use natural
TitleShowTitlefield naming by modifying theTextCheckboxGroupFieldcreation approach, ensuring consistency withBaseElementObjectand enabling proper integration withCustomStylesExtension.Changes Made
🎯 Natural Field Naming Implementation
TextCheckboxGroupField::create('Title')instead of->setName('Title')TitleShowTitlenaturally (SilverStripe framework behavior)BaseElementObjectpattern exactly🔧 Technical Improvements
Integration Context
This change is part of a coordinated update across three repositories to implement unified
TitleShowTitlefield naming:CustomStylesExtensionto position fields usingTitleShowTitleforBaseElementObjectdescendantsTitleShowTitlenaturally (PR #39)Slideclass to match the unified patternTechnical Details
Before
After
Architecture Benefits
BaseElementObjectdescendants now useTitleShowTitleconsistentlyCustomStylesExtensiondynamic positioning logicBackground
This approach was chosen after architectural review of the original implementation. The unified approach ensures:
BaseElementObjectdescendants use the same field naming patternBackwards Compatibility
TitletoTitleShowTitlefor Slide objectsBaseElementObjectchanges for unified rolloutTesting
TitleShowTitlenaturally through framework behaviorTitleShowTitlefield (via CustomStylesExtension)Related PRs
Ready for review. This change completes the unified
TitleShowTitlefield naming implementation across allBaseElementObjectdescendants.