-
-
Notifications
You must be signed in to change notification settings - Fork 568
[5.x] Add config extra sections with fields to existing fieldtypes #11712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 5.x
Are you sure you want to change the base?
Conversation
Be able to create extra sections instead of just single fields.
This comment was marked as resolved.
This comment was marked as resolved.
Hi Duncan! This PR does not add a new method, just enhances how the existing "appendConfigFields" method handles the array when it contains the "fields" key. Please let me know if any questions. |
Sorry, ignore me! 🙈 I was reading #5077 and saw |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you able to add a test for this? It can go in tests/Fields/FieldtypeTest.php
.
Ok will do! |
After reading https://statamic.dev/extending/fieldtypes#adding-configuration-fields-to-existing-fieldtypes I noticed that extra sections are not added to fieldtype config.
Before this fix, it shows like this:
After fixing this issue, it shows fields inside the new section:
After adding
appendConfigFields
to a ServiceProvider, it can be tested on any blueprint at/cp/collections/{collection}/blueprints/{blueprint}/edit
This PR adds extra sections support to #5077 and #7706