Stars: 147
Forks: 29
Pull Requests: 7
Issues: 66
Watchers: 21
Last Updated: 2021-05-31 16:52:22
A Gravity Forms add-on to embed a form in an auto-resizing iframe on external sites.
License:
Languages: JavaScript, PHP
Embed a Gravity Form in an iframe on any site.
Contributors: Brady Vercher
License: GPL-2.0+
The typical process to embed a Gravity Form on a site where the plugin isn't installed requires:
With the Gravity Forms Iframe add-on, just enable a setting to allow the form to be embedded and copy the code snippet. That's it. As a bonus, the iframe automatically resizes whenever the form height changes -- for instance, when fields are shown or hidden due to conditional logic.
The form title and description can be hidden independent of regular form display by toggling a checkbox after enabling the embedding setting.
The form's iframe settings panel.
If the title and description settings need to be changed per embed, they can be modified in the iframe src
query string.
dt
: Set to 1
to display the form title; 0
to hide.dd
: Set to 1
to display the form description; 0
to hide.Example: gfembed/?f=1&dt=0&dd=0
If the auto-resizing functionality isn't needed for a particular form, adjust the iframe's height attribute to accomodate the form and don't include the <script>
tag when copying the embed code. Leaving off the script tag will save an HTTP request.
If you redirect users to another page upon submission and would like the iframe to automatically resize, include the following in the confirmation page:
add_filter( 'gfiframe_print_resize_ping_script', '__return_true' );
Templates can be added in a theme or child theme to override the plugin's template. Use the following template names:
/wp-content/plugins/
.Read the Codex for more information about installing plugins manually.
Clone this repository in /wp-content/plugins/
:
git clone [email protected]:bradyvercher/gravity-forms-iframe.git
Then go to the Plugins screen in your WordPress admin panel and click the Activate link under Gravity Forms Iframe.