How can a plugin, hook into the Drop Down so it can have it's values displayed automatically? Sort of like the Post Fields is, except it would display fields that plugins have added through an "API" of sorts.
Plugin Drop Downs
(10 posts) (5 voices)-
Posted 10 months ago | Permalink
-
Scott,
This is an iteresting idea. So you would like to dynamically change the items of a drop down field via a filter. That way you would be able to add data from a different database table or what have you. Let me know if I on the right track here. Adding hooks and filters is something we usually can do relativelly quickly.Posted 10 months ago | Permalink -
Well, what I'm envisioning is a way for plugins to integrate with Gravity Forms, and not necessarily have to have Gravity Forms add support for each and every plugin. This way, you do the work once and everyone can jump on the band wagon.
That won't be the ideal situation for all plugins, since some have a really specific use beyond just selecting something. But it would be very useful.
So what I'm thinking is this:
1. Pluggable function that more than one plugin can hook into, and provide an array of items and a name for the drop down.
2. Gravity Forms lists these drop downs in alphabetical order in a custom section, like "Post Fields".
3. Provide a section or append to an existing section of the Gravity Help site for 3rd party integration documentation. Currently, you have to be logged in as a premium account to view these, I'm sure there's a good reason for this but it's a bit of a barrier for certain developers - just wanted to provide my concern.
Posted 10 months ago | Permalink -
Alex, I think what Scott is looking for is support for adding new field types to the admin. So like "Post Fields" you can add your own custom field types.
Posted 10 months ago | Permalink -
For instance, Pods would like to integrate with other plugins as much as possible, so having this would make it easy for Pods and other plugins to have their data represented.
All that's really needed (for the majority of plugins) is a simple drop down API, where you can hook in your name / value pairs, and give the drop down a label (what it appears as in the right-hand side where you click to add).
Additionally, hooking into custom fields for plugins to create special fields like an AJAX uploader, or an infinite number of other fields imaginable - would be great to have.
Posted 10 months ago | Permalink -
OK, I think I get the picture. This is obviously a little more involving than what I was talking about, but it makes complete sense. Maybe a good start will be the simpler drop down field API you talked about. We can then see how that shaped up and go from there. We are in the middle of the 1.2 release now, but once that is out, I will touch base with you and see if we can start getting this API going.
Thanks for the support!Posted 10 months ago | Permalink -
Sounds good Alex! Keep up the good work gang!
Posted 10 months ago | Permalink -
I really like the idea of a drop down field API - it would be very useful for creating forms with menus using data from other plugins.
Posted 10 months ago | Permalink -
Even with the existing Gravity Forms API, I still believe some sort of custom action hook to output additional options or what-not into the Form fields would be great.
Posted 4 months ago | Permalink -
+1
Posted 4 months ago | Permalink
Leave A Reply
You must log in to post.