WordPress.org

Ready to get started?Download WordPress

Plugin Directory

Gravity Forms Directory

Add directory capabilities and other functionality to the great Gravity Forms plugin.

To integrate a form with Directory:

  1. Go to the post or page where you would like to add the directory.
  2. Click the "Add Directory" button above the content area.
  3. Choose a form from the drop-down menu and configure settings as you would like them.
  4. Click "Insert Directory". A "shortcode" should appear in the content editor that looks similar to [directory form="#"]
  5. Save the post or page

Configuring Fields & Columns

When editing a form, click on a field to expand the field. Next, click the "Directory" tab. There, you will find options to:

  • Choose whether you would like the field to be a link to the Single Entry View;
  • Hide the field in Directory View; and
  • Hide the field in Single Entry View
  • Enable using the field as an advanced search filter

How do I select what columns I want to display in the Directory?

  1. Edit the Gravity Forms form you'd like to configure a Directory for
  2. Click "Directory Columns" In the Form Editor toolbar (near the top-center of the page)
  3. Drag & drop the fields in the order you'd like them to appear in the directory
    • Drag from the right ("Hidden Columns") side to the left ("Visible Columns") side.
  4. Click the "Save" button
  5. Voila!

How do Directory Search filters work?

If the field is a text field, a text search input will be added that will search only this field. Otherwise, the field choices will be used to populate a dropdown menu search input.

Example: if the "Vehicle Make" field has choices "Ford", "Chevy", and "Toyota", the search dropdown options will have those items as choices in a dropdown search field. If "Ford" is selected and the search form is submitted, only entries with the Vehicle Make of "Ford" will be shown.

To enable a field as a search filter, view "How do I add a field as a Directory Search filter?" below.

How do I add a field as a Directory Search filter?

  1. Edit the Gravity Forms form you'd like to configure a Directory for
  2. Click the bar on the top of the field to expand the field
  3. Click the "Directory" tab
  4. Check the box that says "Use this field as a search filter"
  5. Click "Update Form" to save the form

How do I turn off lightbox grouping?

Add the following to your theme's functions.php file:

add_filter('kws_gf_directory_lightbox_settings_rel', 'turn_off_directory_lightbox_grouping');

function turn_off_directory_lightbox_grouping() {
    return 'nofollow';
}

How do I hide entries from logged-out users?

Turn on the limituser setting, then add the following to your theme's functions.php file:

add_filter('kws_gf_treat_not_logged_in_as_user', '__return_false');

How do I sort by a column?

The sort attribute allows you to sort by an ID. To find the field ID, On the Gravity Forms ├ČEdit Forms├« page, hover over the form and click the link called "IDs" that appears.

If you want to sort by last name, you find the last name id (1.6 for example). Then, you add sort="1.6" to your [directory] shortcode.

Your shortcode could then look something like [directory form="1" sort="1.6"]

I want the URL to be different than `/entry/` - can I do that?

You can! Add the following to your theme's functions.php file:

add_filter('kws_gf_directory_endpoint', 'different_directory_endpoint');

function different_directory_endpoint($endpoint) {
        return 'example'; // Use your preferred text here. Note: punctuation may screw things up.
}

How do I change who created an Entry?

You will see a drop-down input titled "Change Entry Creator" in the Edit Entry "Info" box when you are editing an entry on your site. Change the user in the dropdown, then click the Update button to commit the changes.

  • Only users with entry entry editing capability will be able to see the drop-down and edit the entry (the gravityforms_edit_entries capability)
  • Select a new user from the drop-down, update the entry, and the entry creator will be updated.
  • A note will be added to the entry with the following information:
    • Who changed the entry creator
    • When the change took place
    • Who the previous entry creator was

How do I add a date filter?

To add a filter by date, you add either a start_date or end_date parameter--or both--in YYYY-MM-DD format. Here's an example:

[directory form="14" start_date="1984-10-22" end_date="2011-09-07"]

How do I find a field ID?

On the Gravity Forms "Edit Forms" page, hover over the form and click the link called "IDs" that appears.

What's the license?

This plugin is released under a GPL license.

Form submissions are showing as duplicates.

This is a known issue. If the submission page has both a form in the content and the same form on the sidebar widget, the entry will be submitted twice. We're working on a fix.

How do I remove referrer information from emails?

Add the following to your theme's functions.php file:

remove_filter('gform_pre_submission_filter','gf_yst_store_referrer');

How do I use the filters?

If you want to modify the output of the plugin, you can do so by adding code to your active theme's functions.php file. For more information, check out the add_filter() WordPress Codex page

Plugin filters

  • kws_gf_directory_output, kws_gf_directory_output_'.$form_id - Modify output for all directories or just a single directory, by ID
  • kws_gf_directory_detail, kws_gf_directory_detail_'.$lead_id - Modify output for single entries
  • kws_gf_directory_value, kws_gf_directory_value_'.$input_type, kws_gf_directory_value_'.$field_id - Modify output for fields in general, or based on type (text, date, textarea, etc...), or based on field id.
  • kws_gf_directory_th, kws_gf_directory_th_'.$field_id, kws_gf_directory_th_'.sanitize_title($label) - Modify the <th> names en masse, by field ID, or by field name (lowercase like a slug)
  • kws_gf_directory_lead_image, kws_gf_directory_lead_image_icon, kws_gf_directory_lead_image_image, kws_gf_directory_lead_image_'.$lead_id
  • And many more - search for apply_filters and do_action in the gravity-forms-addons.php file
// This replaces "John" in a first name field with "Jack"
add_filter('kws_gf_directory_value_text', 'john_to_jack');
function john_to_jack($content) {
    return str_replace('John', 'Jack', $content);
}

// This replaces the "Email" table column header with "asdsad"
add_filter('kws_gf_directory_th', 'email_to_asdsad');
function email_to_asdsad($content) {
    return str_replace('Email', 'asdsad', $content);
}

// This replaces "Displaying 1-20" with "asdsad 1 - 20"
add_filter('kws_gf_directory_output', 'displaying_to_asdasd');
function displaying_to_asdasd($content) {
    return str_replace('Displaying', 'asdsad', $content);
}

// This replaces images with the Google icon.
// You can modify all sorts of things using the $img array in this filter.
add_filter('kws_gf_directory_lead_image', 'kws_gf_directory_lead_image_edit');
function kws_gf_directory_lead_image_edit($img = array()) {
    // $img = array('src' => $src, 'size' => $size, 'title' => $title, 'caption' => $caption, 'description' => $description, 'url' => $url, 'code' => "");
        $img['code'] = '';
    return $img;
}

I can't see the fields in the Add Fields box!

The code is meant to expand all the field boxes so you don't need to click them open and closed all the time. This works normally in Safari and Chrome (read: good browsers :-P). For some other browsers, it breaks the whole page.

To fix this issue, add this to your theme's functions.php file:

add_filter('kws_gf_display_all_fields', create_function('$content', 'return "";') );

Requires: 3.3 or higher
Compatible up to: 3.8.3
Last Updated: 2014-4-10
Downloads: 86,784

Ratings

3 stars
3.7 out of 5 stars

Support

1 of 27 support threads in the last two months have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
1 person says it's broken.

100,2,2 100,2,2 100,1,1 100,1,1
100,1,1
100,1,1
0,1,0 33,3,1 100,1,1 100,2,2 100,1,1 50,2,1 50,2,1
100,1,1
100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,2,2 100,3,3
100,1,1 100,1,1
100,1,1 100,1,1 100,1,1
100,2,2
100,2,2 33,3,1 100,2,2 100,1,1 67,3,2 100,1,1 100,2,2
75,4,3
75,4,3
0,3,0
43,7,3
0,6,0
0,2,0 50,2,1 0,5,0
0,2,0
0,3,0 0,1,0
100,1,1
100,1,1 100,1,1
50,2,1 100,1,1 100,2,2
100,2,2 100,2,2 100,1,1 100,1,1
0,1,0