bosconian-dynamics / gf-poplink

A GravityForms AddOn adding strategies and options for creating links and tokens to prefill form fields.
MIT License
0 stars 0 forks source link

Prepopulation form template & form-level override #3

Open bosconian-dynamics opened 3 years ago

bosconian-dynamics commented 3 years ago

Implement a dedicated template file to present for form prepopulation and link generation. Support locate_template() overrides to enable themes and other plugins to supersede the default template.

Provide a form-level setting allowing the template to be overridden with a URL so end-users can prepopulate via a specific page.

bosconian-dynamics commented 3 years ago

9e17c06 saw the prepopulation form refactored into a "virtual pages" implementation which injects a fabricated WP_Post object into the query, deliberately triggers load-sequence actions, and loads a template from the active theme in the order form-{form_id}.php, form.php, page.php, singular.php, index.php.

Keeping the implementation independent from Gravity Forms' preview.php seems a lot more sustainable, and this approach better integrates the active theme's styles and behaviors.

Still to-do is the form-level override for template or page selection. Adding a "Generate Link" button to the form like "Save & Continue" does would still be beneficial, as it would allow end-users to generate links directly to a specific form display, as the independent pre-populate template is sort of clunky in that it presently just tosses back a GET parameter.