I see how I can create the handler by using IFormHandlerType but how can I create the directive for the configuration? Can that be done without altering the Formulate source code?
Instead of doing template: formulateDirectives.get("handlers/sendDataHandler/sendDataHandler.html"), you'd do templateUrl: "/some-path/sendDataHandler.html".
BTW, what kind of handler are you creating? I might be able to provide some tips on an easier alternative to creating your own handler.
At this time we are just looking into how everything works in regards to Formulate in order to understand how/if we can use it in our projects. One potential usecase we have for a custom handler is where there would be conditional logic to determine where data gets posted based on specific form field values for example.
You can almost do that now. You can dynamically set form fields based on the value of other fields, and you can include those dynamic fields when sending data.
The URL is currently part of the configuration screen (i.e., not dynamic). What you could do is submit a pull request to make it possible to set that URL to the value of a field selected in the configuration screen. Then you could use the existing "Send Data" handler to accomplish that same thing.
How to create a custom handler
I see how I can create the handler by using IFormHandlerType but how can I create the directive for the configuration? Can that be done without altering the Formulate source code?
Yep. Here is some info on how to inject JavaScript into the Umbraco back office: https://our.umbraco.com/forum/developers/extending-umbraco/63379-Custom-CSSJavaScript-for-Umbraco-Backoffice
Here's some code you can reference:
Instead of doing
template: formulateDirectives.get("handlers/sendDataHandler/sendDataHandler.html")
, you'd dotemplateUrl: "/some-path/sendDataHandler.html"
.BTW, what kind of handler are you creating? I might be able to provide some tips on an easier alternative to creating your own handler.
At this time we are just looking into how everything works in regards to Formulate in order to understand how/if we can use it in our projects. One potential usecase we have for a custom handler is where there would be conditional logic to determine where data gets posted based on specific form field values for example.
Gotcha.
You can almost do that now. You can dynamically set form fields based on the value of other fields, and you can include those dynamic fields when sending data.
The URL is currently part of the configuration screen (i.e., not dynamic). What you could do is submit a pull request to make it possible to set that URL to the value of a field selected in the configuration screen. Then you could use the existing "Send Data" handler to accomplish that same thing.
Alternatively, you could submit a pull request that modifies the SendingData event so that the URL can be modified with an event handler: https://github.com/rhythmagency/formulate/blob/master/src/formulate.app/Forms/Handlers/SendData/SendDataHandler.cs#L364-L373
is working on a reply...