Add directory capabilities and other functionality to the great Gravity Forms plugin.
GravityView is the best way to display Gravity Forms entries
We set out to make a better Directory plugin, and we did it: GravityView takes displaying your form entries to the next level. It is easier, more powerful and more customizable than the Directory plugin. You’ll love GravityView.
Check out GravityView or try a demo today!
Gravity Forms is already the easiest form plugin…now, the Gravity Forms Directory & Addons plugin turns Gravity Forms into a great directory.
[directory]
shortcode<ul>
), or definition list (<dl>
)There are tons of configurable options for how you want the directory to display.
[directory form="#"]
When editing a form, click on a field to expand the field. Next, click the “Directory” tab. There, you will find options to:
Approving directory entries is very easy
When using the Form Editor, your form fields will have a Directory tab for easily modifying your display options.
This plugin adds an Edit link to Gravity Form entries
Insert a directory
How the Gravity Forms widget appears on the widgets page
The Gravity Forms Addons settings page, found in the Forms > Directory & Addons menu link
How the Gravity Forms 'Add Fields' boxes look after plugin is activated
[directory form="#"]
When editing a form, click on a field to expand the field. Next, click the “Directory” tab. There, you will find options to:
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.
The plugin is fully translatable. Go here to contribute a translation and we will include it in the next update!
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'; }
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');
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"]
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. }
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.
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"]
On the Gravity Forms “Edit Forms” page, hover over the form and click the link called “IDs” that appears.
This plugin is released under a GPL license.
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.
Add the following to your theme’s functions.php
file:
remove_filter('gform_pre_submission_filter','gf_yst_store_referrer');
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
kws_gf_directory_output
, kws_gf_directory_output_'.$form_id
– Modify output for all directories or just a single directory, by IDkws_gf_directory_detail
, kws_gf_directory_detail_'.$lead_id
– Modify output for single entrieskws_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
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; }
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 "";') );
Since 3.6.3, the Directory plugin displays formatted values (like currency). To disable that, add the code below to your theme’s functions.php
file:
add_filter('kws_gf_directory_format_value', '__return_false' );
Since 4.1, Bulk Approval requires Gravity Forms 2.2.4 (released August 8, 2017). Please update your Gravity Forms.
Since 4.1, Smart Approval may return inaccurate entry counts. This will be fixed automatically once Gravity Forms 2.3 is released and installed on your site.
New:
Fixed:
Improvements:
0
would not filter entriesA big update to make Gravity Forms Directory compatible with Gravity Forms 2.3, and to fix entry approval.
Gravity Forms Directory is not under active development. We’re focusing on GravityView, which is a way better plugin! Try it out for 30 days, if you don’t like it, we’ll give you your money back.
New:
Fixed:
gravityforms_edit_entries
capabilities to edit entries (previously, only users with gravityforms_directory
capability)0
valuesImprovements:
GF_Field
instead of arrayget_currentuserinfo()
functionadd_query_arg()
function. Please update!Learn about the issueload_plugin_textdomain()
for translationskws_gf_directory_image_extensions
filter to modify what image formats to supportrender_image_link()
method to render imageswpautop
and fulltext
parameters – full text, styled using paragraphs is always usedkws_gf_tablesorter_theme
filter: black-ice
, blue
, bootstrap
, bootstrap_2
, dark
, default
, dropbox
, green
, grey
, ice
, jui
nofollow
and target
configurationfixed
table class, this was conflicting with several WordPress themes’ CSSwp-content
to be a different namechange-lead-creator.php
to gravity-forms-lead-creator.php
as WordPress activates the first file with plugin info encountered in the directory (ordered by name) – this way, the main file gravity-forms-addons.php
will appear first.kws_gf_entry_creator_users
) for the Change Entry Creator plugin. This allows you to define what users appear in the dropdown (as an array of WP_User
objects). If no users are specified, all users are shown.The fixes in this update were submitted by Dylan Bartlett. Thanks, Dylan!
gf_edit_forms
only when editing a specific formsort_field_number
instead of sort_field
for the get_leads()
methodWP_PLUGIN_URL
with plugins_url()
to prevent mixed content warnings when editing forms over HTTPS (thanks, dbarlett)entryback
link setting (previously, only the global setting was respected)remove_admin_only()
method and replaced with remove_hidden_fields()
Notice: Trying to get property of non-object[...]on line 4051
errorlive()
to on()
<th>
instead of <td>
for headingsentrydetailtitle
, which allows you to easily overwrite the Entry View table headingkws_gf_directory_lead_being_edited
and kws_gf_directory_form_being_edited
filters to allow users to modify what fields should be shown for editing.kws_gf_date_format
filter for Directory date formatkws_gf_directory_tick
filter for changing the check mark in the directoryicon
, showrowids
)fulltext
was enabledcompact
now properly implemented. This is to better inform content filters.<th>
, as requestedlimituser
option – a new option to show only entries users have created. You can also hide entries from not-logged-in users (see FAQ).lightboxsettings
shortcode attribute (but is backward compatible with entrylightbox
and lightbox
settings)kws_gf_directory_colorbox_settings
filter to allow you to modify the settingskws_gf_directory_lightbox_settings_rel
filter to modify (see FAQ)list
input type supportGFFormDisplay
class wasn’t defined.<head>
date_created
field (issue #649652)?row=#
for the back-link to the directory. There was no need for it to get the lead ID.apply_filters
and do_action
.Sorry for the many updates in one day, but I can only fix many bugs as they get reported.
site_url()
instead of get_bloginfo()
start_date
and end_date
shortcode generationWarning: require_once(directory.php): failed to open stream: No such file or directory
warning when using lightbox to view single entries.This release should fix some major issues users were having with 3.0. Sorry for the problems.
start_date
and end_date
settings to Insert Directory form with datepicker?start_date=YYYY-MM-DD
to the directory URL)jstable
setting to enable javascript sorting using the Tablesorter script. Includes kws_gf_directory_tablesorter_options
filter to modify Tablesorter settings.page_size
setting: setting a page size of 0 now shows all entries.enqueue_files
function.GFDirectory
class.entries
…see FAQ for more information)Note: This update has only been tested with WordPress 3.2 and Gravity Forms 1.5.2.8 and Gravity Forms 1.6 beta.
dl
; single-entry view entries are now wrapped with single dl
<liclass
now <li class
(thanks @lolawson)jssearch
, under Formatting Options)class
of even and odd for rows<ul>
), or definition list (<dl>
)kws_gf_directory_defaults
filter to update plugin defaults.appendaddress
setting. This will add a column to the output with a combined, formatted address. Use new hideaddresspieces
setting to turn off the individual address pieces. Instead of having Street, City, State, ZIP, now there’s one column “Address”truncatelink
option (explained below)http://example.example.choicehotels.com/hotel/tx173
becomes choicehotels.com
, but will still link to the full URL. kws_gf_directory_anchor_text_striphttp
kws_gf_directory_anchor_text_stripwww
example.com/inner-page/
becomes example.com
): kws_gf_directory_anchor_text_rootonly
kws_gf_directory_anchor_text_nosubdomain
example.com?search=example&action=search
becomes example.com
): kws_gf_directory_anchor_text_noquerystring
kws_gf_results_pagination