-
-
Notifications
You must be signed in to change notification settings - Fork 554
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
[5.x] Support fieldsets in subdirectories #9341
base: 5.x
Are you sure you want to change the base?
Conversation
Hey @duncanmcclean, this is a great PR! Curious if there are plans to merge this in the near-ish future? We're using nested fieldsets in a project, and it actually seems to work for the most part, but CP access is broken (ie, throws a |
Sorry, we don't have an ETA for reviewing/merging this pull request. We'll get to it when we can. In the meantime, you can pull this PR into your project with a composer patch. |
No problem and no rush, just thought I'd check—thanks Duncan, appreciate the update! |
…ubdirectories # Conflicts: # resources/js/components/fieldsets/CreateForm.vue # src/Http/Controllers/CP/Fields/FieldsetController.php
…fieldset handles
# Conflicts: # tests/Feature/Fieldsets/StoreFieldsetTest.php
Thanks @JorisOrangeStudio - should be fixed now! |
Thanks! In the Statamic core it is currently already possible to add fieldsets in subdirectories, only the namespace get prefixed and the listing in the CP is still all combined. I found out that abovr issue (to import a 'subdirectoried' single field) throws the same error without this patch installed. Should I make an issue for this, or can te latest commit also be used to fix this in core (if this PR gets merged)? |
It only really works by fluke right now, it's never been intentionally supported until this PR.
Yes, the latest commit will fix it. |
Could you consider adding a description field for fieldsets for display within the CP? It would be used to explain how a fieldset should be used within the blueprints. |
We could do that in a separate PR. |
This pull request adds support for creating & managing fieldsets located in subdirectories. This was already kinda possible but there was a few rough edges, which this PR sorts out.
One of the rough edges was the fact you couldn't previously create a fieldset in a subdirectory in the Control Panel, you had to go in and manually create the file.
This PR fixes that so you can create fieldsets in subdirectories, using this syntax:
components.team_members
Another change I've made is that fieldsets in subdirectories will be split out into separate groups on the Fieldsets Index page, like we do for namespaced fieldsets.
Here's an example of what that looks like (the "My Fieldsets" group will always be displayed first):
One last thing I had to fix was deleting fieldsets. Previously, the
FieldsetRepository@delete
method was manually constructing the file path and it wasn't replacing.
with/
. I've adjusted this to use the fieldset'spath
instead which takes this into account.Closes #3178.
Closes statamic/ideas#915.
Closes statamic/ideas#560.