The Ninja Forms extension for Download Monitor allows you to require users to fill in a Ninja Forms form before they gain access to a download.
- Unzip and upload the plugin’s folder to your /wp-content/plugins/ directory
- Activate the extension through the ‘Plugins’ menu in WordPress
For more information on installing and managing plugins see here
After installing the extension head over to the download you wish to lock with a Ninja Forms form.
Lock the download
Edit the download you wish to lock with a form. If you scroll down the page you'll find a new meta box on the right side called "Ninja Forms Form". Select the form you want users to fill in prior download and save/update the download.
Insert the unlock download form shortcode
The Ninja Forms extension comes with a new shortcode that will display the Ninja Forms form and will display a download link to the file after the form has been successfully. You need to pass your download ID to this shortcode, we used download ID
5 in our example.
Unlocking via the No Access page
Instead of displaying the unlock form on your page you can also display the default download link by using the
[download] shortcode. When the visitor clicks the link, Download Monitor will check if the user has already unlocked the download. If they didn't yet, a No Access page will be displayed. The Ninja Forms extension automatically appends the correct Ninja Forms form to the No Access page so your visitor can unlock the download there.
[download]shortcode, you can use all of the shortcode's attributes like output templates!
Since version 1.1.0 you can set the type of unlocking that will be done once a form is completed. The default type is unlocking the requested download (the download the form was attached to) but you can also choose to:
- Unlock all downloads locked with the same form
- Unlock all Ninja Forms locked downloads
You can find the unlock type setting at the Ninja Forms tab in your Download Monitor settings page.
Offer the Download after form completion
After your visitors completed your form, you most likely want to offer them the locked download instantly. There are two main ways of doing so.
Add a Download Link to your Success Message
Adding a Download Link to your success message allows you to thank you visitor for completing the form while offering an instant way to download to unlocked file. The Download Link is a Ninja Forms Action which can be added in the Emails & Actions tab > by pressing the blue + in order to add another action.
The Download Link will automatically link to the download the visitor just unlocked. This way you can reuse the same form for multiple downloads.
Redirect to Download
By redirecting the visitor to the download after form completion, you're instantly offering your file to your visitor. The Download Redirect is a Ninja Forms Action which can be added in the Emails & Actions tab > by pressing the blue + in order to add another action..
The visitor will automatically be redirected to the download they just unlocked. This way you can reuse the same form for multiple downloads.
If you've followed above steps in the Usage section your download is ready to go. Visitors will be have to complete the selected Ninja Forms form prior be granted access to the download.
After the visitor completed the form, the Ninja Forms extension will append a download link to your confirmation message. This URL will be automatically generated based on the download shortcode you've used.
Can I use both the Download Link and Download Redirect action?
You can! When both Download Monitor actions are added to a form, the redirect will be fired with the download button (and other success messages) displayed in the background.
Can I change the download link/button HTML that is used in the Download Link Action?
You can! The Ninja Forms extension comes with an overridable template file
nf-download-link.php. Copy this file to your the
download-monitor directory in your theme (create the directory if it doesn't exist) and modify the file you just copied to your theme any way you want. This way you can still safely update the extension without losing these customizations!