-
-
Notifications
You must be signed in to change notification settings - Fork 536
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] Make it possible to add to form configuration screen #8491
[5.x] Make it possible to add to form configuration screen #8491
Conversation
+1, this would be a really valuable addition! 👍 |
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.
After some initial testing, this is working well. I've left a few comments with some thoughts.
[maybe a dumb] question on this...would config values be accessible within the blueprint? Eg, could you set blueprint field visibility based on one of these new config fields? 🤔 |
@caseydwyer not as things stand |
If you get a chance could you update this for the latest Statamic version? (for composer patches) Thanks :) |
@godismyjudge95 sure - done! |
I have been using this pull request as a patch and the latest version seems to be missing use Statamic\Support\Arr; from the appendConfigFields function |
@ryanmitchell would it be possible to update this pr? Attempting to update a few sites to Statamic 5 |
@godismyjudge95 its already been updated for 5.x |
Oh weird... I was getting an error about not being able to apply it as a composer patch. Must be something on my end then. |
Hi there the patch is also not applying correctly for me either for example I can see that there are some extra classes in the use statement for eample this is the updated patch for the Form class
The original patch did not have the SubmissionQueryBuilder line in it so was rejected |
Yes it’s been update for v5 and there are other changes made in v5. If you are trying to patch tov4 it won’t work. |
I'm using v5 though, it is this patch https://patch-diff.githubusercontent.com/raw/statamic/cms/pull/8491.patch that we should be using right?
The code above is from the patch, it's not correct as there is no SubmissionQueryBuilder line, it will fail as the latest version of v5 which I am using has that in it. |
Ok no probs, I have patched them myself anyway so all good for now, hopefully this PR can be merged in soon, thanks for having a look. |
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.
Thanks for thie PR. Sorry for the delay. 😅
Just a few minor tweaks.
- It's
Form::appendConfigFields
andForm::extraConfigFor
to match other places (likeFieldtype::appendConfigFields
)
Amazing, this will be so useful. Thank you. |
Not sure if this is niche, but it would be really useful to be able to add to the form configuration screen so that fields can be modified through the UI. This is specifically useful when we want to integrate with 3rd party services (such as adding a Zapier URL), but also may be useful for other developers to add things such as success messages.
I can also see it being useful for add-ons (such as Mailchimp).
I initially thought of adding a "configuration" section with a blueprint builder, but that is a config screen to modify a config screen and that doesn't feel right to me.
So instead, what I'm suggesting is adding ContainsData to forms, and giving the ability for developers to register extra fields using the following method:
You can also pass a $handle of '*' if you want the fields to be added to all forms.
This then appends a config section to the screen as follows:
My config call for this is as follows:
Is this something you might consider?
Closes statamic/ideas#1112