Documentation:UBC Content Management System/Plugins/Gravity Forms
UBC CMS Codex | |
---|---|
Welcome to the support documentation for the UBC CMS Service. | |
Contents | |
UBC Collab Theme | |
UBC Collab Theme Overview | |
Gravity Forms can be used to create online forms that site visitors can fill out and an email notification will be sent to the author each time a form is submitted. An example of such a form could ask users to fill out information for an upcoming event.
Important Notice
When using Gravity Forms, do not store/collect any sensitive information. Sensitive information includes student numbers, CWL information, and private personal information. Furthermore, please don't use Gravity Forms for mission-critical information; even though we keep database backups, data loss still might occur.
Form Setup
Log in to your site, if you haven't already done so.
Activate Gravity Forms
- Select Dashboard -> Plugins and scroll down to Gravity Forms. On the right, there should be a link to activate the plugin for your site (Enabling Plugins).
- A new menu item should appear in the menu bar found on the left side called Forms.
Add a New Form
- Go to Dashboard -> Forms -> New Form.
- Create your form. Check out this video: Using Gravity Forms (video duration 4:23 min).
- Save the form.
Optional: Confirmation Notice
- Go to Dashboard -> Forms -> Edit Forms and select the form you wish to change
- Click on the "Form Settings" selection in the gray header menu
- Select the "Confirmation" tab and edit the confirmation text field
- If you also wish to add any of the information submitted through the form (ex: name):
- Select the "Text" radio button on the "Confirmation" tab
- Enter the text that you'd like to precede the form item (name example: "Thank you, ")
- Select the form item you'd like to have appear in the confirmation message from the "Insert from field" dropdown
- Your message in the text field should look similar to this: "Thank you, {Name (First):3.3}"
- If you also wish to add any of the information submitted through the form (ex: name):
- Alternately, you can also link to an internal or external page upon confirmation by selecting the "Page" or "Redirect" radio button respectively
Embed the form onto a page
- Either create a new Page or edit an existing Page: Dashboard -> Pages -> New Page or Dashboard -> Pages -> Pages.
- Add the form to the page. Use the gray button between the page title and page body. Note: This is shown in the video above.
- Save the Page.
Receive emails from the form
- Go to Dashboard -> Forms -> Edit Forms.
- Mouse over the name of the form you just created. You should be able to see a "Notifications" link appear below your form's name. Click it.
- Under the "Notification to Administrator" heading select the "Enable email notification to administrators" checkbox and fill out the form.
- Scroll down and save the form.
Test the form
- Go to the page that you just created and fill out your form. Check that you received an email with the information you entered.
- Check if the form has a new entry. Go to Dashboard -> Forms -> Edit Forms and check the Entries column, or go to Dashboard -> Forms -> Entries and select the form you just created.
Add reCAPTCHA(optional, but highly recommended)
Any web form showing on your site without protection has the potential to cause spams on daily basis. It is recommended to install Google reCAPTCHA for sites on UBC CMS that uses Gravity Forms.
- To start using reCAPTCHA, you need to sign up for an API key pair for your site. Under reCAPTCHA type, please choose reCAPTCHA V3. Under domains, If your site has not been domain mapped yet, please add the domain that provided by UBC CMS team after the site creation. (please do not include protocols such as http:// or https://). If your site has been domain mapped, please make sure to add both the domain provided by CMS team and the primary domain that your site is currently using(please do not include protocols such as http:// or https://). As an example, for the main CMS website, cms.ubc.ca, we would add the two domains as following: cms.ubc.ca and cms2.sites.olt.ubc.ca -- neither have a protocol, and neither end with a forward slash. Google doesn't make it obvious, but it is very picky about getting the domains exactly correct. Once all the information are correctly filled on the page, please click the submit button. You will then receive a pair of 'Site Key' and 'Secret Key' from Google.
- Login to your site's Dashboard an go to 'Plugins'. Search for 'Gravity Forms reCAPTCHA Add-On' and activate it.
- Go to Dashboard -> Forms -> Settings. Under 'reCAPTCHA' tab and below 'reCAPTCHA v3' section. Paste in the key pair received from step 1) and click 'Save Settings' button at the very bottom of the page.
Troubleshooting
Solutions to common Gravity Forms problems:
If you didn't get the entry email
Wait a bit, it might take up to half an hour to get the email. Check your spam to make sure it didn't go in there.
Do Gravity Forms support submission preview?
Gravity Forms do not support submission preview. According to this post, the submission preview feature was supposed to be part of the 1.3 release.
Tips
Conditional shortcode with Gravity Forms:
https://gravitywiz.com/gravity-forms-conditional-shortcode/
Sample Usage: Show Content Only if Value Exists
[gravityforms action="conditional" merge_tag="{My Field:1}" condition="isnot" value=""]<br /> My Field Label: {My Field:1}<br /> [/gravityforms]