1. Home
  2. Docs
  3. Integrations
  4. Ninja Forms

Ninja Forms


Introduction
Preparation
Contact Form
Claim
FAQ

Introduction

This doc covers two (2) Ninja Forms integrations. The first is to provide your visitors with a “Send Enquiry” type button to fill out a form to contact the listing owner by email using the ’email’ field. The second is using a Ninja Form to allow users to ‘Claim’ a listing.

Preparation

For the guide you have completed the following:

  1. Setup Geodirectory (Beta Version 2.0.0.5-beta or higher)
  2. Install and Activate Ninja Forms
  3. Optional – For Claim form – Setup claim Listings Addon

Contact Form Setup

Open the Ninja Forms menu in WordPress to “Add New” to see the list of Forms that come with Ninja Forms. In the list you will see the “GeoDirectory Contact Form”.

Only the “GeoDirectory Contact Form” form template comes prepared with the hidden field necessary to make this integration work. The form you create must use this template, as shown here:

  1. Navigate to Ninja Forms – Add new form
  2. Select the “GeoDirectory Contact form”
  3. Edit and save the form.
  4. Visit WP – Appearance – Widgets
  5. Add GD > Ninja Forms Widget to Sidebar, and set for Display on Detail Page

Form Display Options

You have several options for how you can display the option to use a form.

Display Complete Form in Tab

It is also possible to display the complete form in the tab of a detail page.

  1. Visit CPT – Settings – Tabs
  2. Click on Shortcode on the left side to add a new shortcode field to the right side.
  3. Fill in Ninja Form form shortcode.
  4. Change the name of the tab if desired.
  5. View CPT Detail page of a listing to see the form output.

Lightbox Button

Once a form integration is setup, you can also use the following shortcode to display a button to launch your form in a lightbox popup. This button can easily be added to the Detail or Archive Item templates, or a tab.

Adjust the form_id to that of your GeoDirectory Contact Form.
Adjust the text param to change the text on the button.

[gd_ninja_forms form_id="3" text="Contact form" post_contact="1" output="button"]

Widget Sidebar Lightbox Button

  1. Visit WP – Appearance – Widgets
  2. Select the GD > Ninja Forms widget
  3. Set the widget to display in the Sidebar that is visible on Detail Page
  4. Configure the widget for the correct Ninja Form form_id
  5. Check the option “GD Contact Form” to only display the widget if the listing email is populated.
  6. Save settings
  7. Visit the Detail page to confirm display of the form.

Add Lightbox Button to Detail Page Template

Do you want to place the button somewhere specific on the Detail page, within the content area, instead of in the sidebar?

To do that, you will edit the Detail page template.

  1. Navigate to your site’s Detai page template
  2. Edit the template (page)
  3. Add your Lighbox Button shortcode to the template

Add Lightbox Button to Archive Item Page template

Do you want to place the button somewhere specific in the Archive Item display, so the button shows up for each listing on the Listing page?

To do that, you will edit the Archive Item page template.

  1. Navigate to your site’s Archive Item page template
  2. Edit the template (page)
  3. Add your Lighbox Button shortcode to the template

Claim Form

You should complete all the steps outlined in the Claim Listing addon setup before setting up your Ninja Form for Claim Listings.

Open the Ninja Forms menu in WordPress to “Add New” to see the list of Forms that come with Ninja Forms. In the list you will see the “GeoDirectory Claim Form”.

Only the “GeoDirectory Claim Form” form template comes prepared with the hidden field necessary to make this integration work. The form you create must use this template, as shown here:

Pricing Manager Integration

If you are also using the Pricing Manager addon, you can add an additional field to allow the user to select the desired price package and proceed to checkout. Be sure to have set the Price Packages for all listings.

Select the field by clicking the “+” to add a new field. Then drag the field on to your form.

Drag the field to re-order it and place it where you want.

Claim Form Design Options

The Ninja Forms integration for the claim form can only be used as a popup with the GD > Ninja Form widget as shown below.

Be sure to disable the “Is Contact Form” from the advanced options.

FAQ – Frequently Asked Questions

My form is setup, but the email is not sent to the listing email. What do I do?

Here are some items you can check:

I want to make a form from scratch, what do I do?

If you are feeling adventurous and want to setup a form from scratch to integrate with GD Listings, then these two settings are required.

1. If your form will be displayed anywhere besides the detail page, then there must be a hidden field with the following settings:

2. Then, the Email Notification, in order to be sent to the email field of the listing, needs to be setup like this, to send the email to {GD:listing_email} instead of the default {system:admin_email}.

FAQ

Maintenance Mode

Error: “This form is currently undergoing maintenance. Please try again later. ”

Check the form settings and CHECK: Remove Maintenance Mode

Was this article helpful to you? Yes 1 No