The [slp_directory] shortcode is used to place a directory listing on a page or post. There are two main modes of operation for the shortcode which is determined but the listing style selected. The list style is determined via the style attribute. The two modes are “list mode” and “landing page” mode. These modes are described below.
The following attributes apply to the [slp_directory] shortcode.
Determined which field to build a list on when style is set to list or list_with_count. See List Mode below for more details.
If the specified field in the by=”<field_slug>” attribute is blank, output the specified if_blank_use field instead.
This can be particularly helpful when using the additional territory field that is added by the Power Add On where you wish to built a listing based on territories, but do not wish to skip locations that do not have a specific territory assigned.
[slp_directory by="territory" if_blank_use="city" landing_page="/locations/" style="list_with_count"]
This will list all of the territories assigned to locations within the system. Any location that does not have a territory assigned will create a city entry on the territory list. When the list is linked to a Store Locator Plus map page, as is shown above, the link will create the proper city or territory-centric search.
landing_page=”<relative page url>”
If set the list that is generated will link to this page and pass along the field and field value to the landing page. When pointed to a WordPress page or post that includes the slp_directory style=”landing_page” shortcode, the landing page will automatically generate a location details list for all locations where the by setting above matches the value on the list. For example, show all locations in the city of Charleston.
locator_page=”<relative page url>”
If set the list that is generated will link to this page and pass along the field and field value to the locator page. When pointed to a WordPress page or post that includes the slplus shortcode, the locator search form and map will automatically search all locations where the by setting above matches the value on the list. For example, show all locations in the city of Charleston.
style=”list | list_with_count | landing_page | title”
Determine the style of listing.
List is a simple list of the property specified in the by attribute, such as a list of cities.
List_with_count is the same as the list style with the addition of a count of locations in parenthesis.
Landing_page is a special mode that expects to get information from a list or list_with_count directory page that has specified a landing_page. This mode will output a detailed list of locations that match the specified “by” field.
Title will display the current filter by field followed by the filter value. For example “City Charleston”. This can be used to prepend a landing page output or a locator map.
The text_if_blank attribute provides a way to set optional text to display if the specified “by” field is blank. This features is provided via the Premier Plugin available exclusively to Premier Subscriptions.
Use the slp_directory shortcode to show a list of your location attributes, such as a list of cities or countries where you have locations. The list is dynamic and will change whenever you change your location data. The list can link to a Store Locator Plus map page or to a direcotry landing page.
Use the slp_directory shortcode with a style=”landing_page” attribute to create a page that will automatically list all the locations that match a specific location attribute, such as all locations in a given city. This page is meant to be hidden from the general user interface on your site. It is meant to be linked to from the automated List Mode output.