This is all based on the default "accessible" template from the plugin. While I know I could put the fields manually in the template, I would prefer to learn how this is actually done "nicely". Thanks!

1 Answer
1

In Craft 3, you can do this by overriding the field inputs directly, and you shouldn't have to add any logic to the form, tab, or fields templates. We're still working on getting the docs updated to properly show this.

Custom Form Templates

To override field inputs in Sprout Forms, you can enable Form Overrides in your settings.

Sprout Forms->Settings->General->Default Form Templates->Custom

Here you can define an override folder in your front-end templates. Let's say you set your default templates to _forms. This means your override templates will exist in templates/_forms.

Once you have that in place, you can place a fields folder within that folder that contains a field override:

Making Your Form Templates into a Plugin

If you like the templates you've created and wish to reuse them on more than one project, you can take what you've done above and wrap it in a plugin.

Creating a Form Template integration will display your Form Templates in the dropdown list of Templates to choose from. The template files themselves would then be managed in your plugin instead of in your project.

You can see an example of how to create an integration in Sprout Forms with the AccessibleTemplates Form Templates: