[slplus] Shortcode

[slplus] is the primary shortcode used within WordPress sites to display the Store Locator Plus map and location search interface.

A shortcode is a special label inside of square brackets that is used within WordPress pages and posts to display the output from a plugin. You place a shortcode within the text of your page or post and the plugin will “do it’s magic”.

Note: Shortcode attributes WILL NOT WORK if Force Load JavaScript is turned on under Store Locator Plus General Settings. Try turning it off before using attributes. If Store Locator Plus won’t load when you turn Force Load JavaScript off, get a different WordPress Theme that fully implements WordPress code standards.

Note: WordPress Plugin API update 4.2.3 effects shortcodes with filtered styles which will not be recognized when stored between quotes.

Locator Shortcode

To display the Store Locator Plus search form, map, and search results using the defaults you have setup via Map Settings in the admin panel, use the following shortcode:

The base plugin will replace the shortcode with a search form, a Google Map, and a results section below the map. Depending on how you have the plugin configured the map and results may start by showing some or all of your locations.

Extended Attributes

You can use the following settings to modify how the store locator interface is displayed on the page:

Attributes are added inside the short code, for example: [SLPLUS center_map_at=”Charleston, SC”]

address_placeholder

The string that is placed in the address input box as a placeholder until the user starts typing.

Requires Experience Add On.

allow_addy_in_url

Determine whether or not the current locator page allows addresses to be passed in via the URL string.

Requires Experience Add On.

center_map_at

Overrides the address where the map will be centered. This attribute will only work if Force Load JavaScript is disabled. Turn this off on the Map Settings page in Store Locator Plus. If the map stops working when turning off Force Load JavaScript, your theme is not properly updated to work with WordPress and does not handle footer action hooks. Contact your theme author and ask them to add footer action hook process as noted in the
wp_enqueue_scripts() section of the WordPress Codex.

Example

city

Set a city string for use with the hidden city input. This will force the search to use discrete mode filters and only return those results where the city matches the EXACT text entered here. Cities should include the city and state separated by a comma and space. For example: Charleston,SC.

Requires Experience Add On.

Example

city_selector

Determine which city selector interface is to be displayed on the map.

Requires Experience Add On.

Values

This attribute can be set to:

  • discrete – show a drop down menu that is used to filter searches to only return locations that EXACTLY MATCH the
    city the user picks on the drop down menu.
  • hidden – hide the city selector input
  • input – show a drop down menu that will automatically fill in the address search box with the state the user
    picks on the menu, allowing the user to further modify the address such as adding a street to the city. This is
    used when you want to give the users some hint as to where your locations are but still rely primarily on radius
    based search results.

Example

country

Set a country string for use with the hidden country input. This will force the search to use discrete mode filters and only return those results where the country matches the EXACT text entered here.

Requires Experience Add On.

Example

country_selector

Determine which country selector interface is to be displayed on the map.
Requires Experience Add On.

Values

This attribute can be set to:

  • discrete – show a drop down menu that is used to filter searches to only return locations that EXACTLY MATCH the
    country the user picks on the drop down menu.
  • hidden – hide the country selector input
  • input – show a drop down menu that will automatically fill in the address search box with the country the user
    picks on the menu, allowing the user to further modify the address such as adding a street to the country. This
    is used when you want to give the users some hint as to where your locations are but still rely primarily on
    radius based search results.

Example

endicon

This will override the Map Settings destination icons on a per-page basis. The URL can be relative to your WordPress site or a fully qualified URL.
Requires Experience Add On.

Example

google_map_style

A properly-formatted JSON string that includes the various options available for Google internal map styling.  Some of the Store Locator Plus style gallery entries contain Google Map Styling settings.

Requires Experience Add On.

hide_map

Show or hide the map on a per-shortcode basis. Note: As of Enhanced Map 4.3, a drop down selector when Enhanced Map is installed and current may be used instead: Show Map, Hide until Search, or Display Image until search.
Requires Experience Add On.

Example

hide_search_form

Turn the search form on or off on a per-page basis. Themes and CSS settings that hide the search form will take precedence over this setting. This setting takes precedence over the Enhanced Search “hide search form” checkbox.
Requires Experience Add On.

Examples

homeicon

This will override the Map Settings home icon on a per-page basis. The URL can be relative to your WordPress site or a fully qualified URL.
Requires Experience Add On.

Example

ignore_radius

Ignore the radius, return all results that match the filters and search criteria provided up to the location limit specified. Shortcode attribute takes precedence over the admin panel “Ignore Radius” setting.
Requires Experience Add On.

Radius

Turn off the radius limitation for the page containing the shortcode:

Use the standard radius limitation to return results.

immediately_show_locations

Overrides the global immediately show locations setting on a per-page basis. When set to true the page will bring up locations based on the Center Map At and Radius To Search Initially settings.
Requires Experience Add On.

Immediately Show Locations

Show locations within the default radius of the default map center.

DO NOT Immediately Show Locations

The user must search for an address before locations are shown.

initial_radius

Override the default initial radius used for immediately show locations mode.

Example

initial_results_returned

Override the default initial results returned for immediately show locations mode.
Requires Experience Add On.

Example

only_with_category

When this shortcode option is provided the map will only display results that have been assigned the specified category. The only_with_category attributed must be set to the catgory slug. It is not case sensitive.
Requires Power Add On.

Example

only_with_tag

You can also force the search form to only return results that match a specific tag by using the ‘only_with_tag’ attribute. For this feature to work, you must have the tag input option turned on in map settings. This setting will override the default pulldown and the shortcode attribute “tags_for_pulldown”.
Requires Power Add On.

Example

order_by

Set the default results order, overriding ordering options set Globally. This is a feature for advanced users. This parameter
Requires Experience Add On.
required proper data field
names
to be used in the attribute values. If they are incorrect the search results may break. The value of this attribute should be the ORDER BY clause of a MySQL statement for the Store Locator Plus base and extended data tables. If you are not certain about the field names you can use a tool like the Database Peek plugin to view the *store_locator and *slp_extendo table structures to get the field names that are available.

Sort By Featured Locations At Top, Then Store Name

This will put all featured locations within the search radius at the top of the list sorted by store name followed by all non-featured stores in the radius sorted by store name.

Defaults Distance Based Results

Sort all results by closest to furthest from the searched or map-center address.

results_box_title

The string for the results box title for Store Locator Plus styles in the Style Gallery that support it.

Requires Experience Add On.

show_maptoggle

Show the map on/off slider on the user interface.
Requires Experience Add On.

Example

state

Set a state string for use with the hidden state input. This will force the search to use discrete mode filters and only return those results where the state matches the EXACT text entered here.
Requires Experience Add On.

Example

state_selector

Determine which state selector interface is to be displayed on the map.
Requires Experience Add On.

Values

This attribute can be set to:

  • discrete – show a drop down menu that is used to filter searches to only return locations that EXACTLY MATCH the
    state the user picks on the drop down menu.
  • hidden – hide the state selector input
  • input – show a drop down menu that will automatically fill in the address search box with the state the user
    picks on the menu, allowing the user to further modify the address such as adding a street to the state. This is
    used when you want to give the users some hint as to where your locations are but still rely primarily on radius
    based search results.

Example

tags_for_pulldown

You can override the default pulldown list of tags on any page by using the tags_for_pulldown attribute on the shortcode. You specify each entry that you want to have appear on the pulldown separated by commas. In order for the search results to return a value the tags will need to be entered exactly as they were input in the database when adding locations. Like the default pulldown entries specified on the map settings page, you can specify the default by putting it in parenthesis. The custom pulldown list will continue to honor the “include any” setting on the map settings page. If that option is checked off then your custom tag list will start with (any) that will match any entry in the database regardless of what tags are associated with the location. For this feature to work, you must have the tag input option turned on in map settings.
Requires Experience Add On.

Example

theme

You can have a different Store Locator Plus theme on each page of your site that is using the store locator shortcode.

Example

pages

There is a new shortcode that renders a direct Google Map with JavaScript if you have Pages active.
Requires Power Add On.

That version contains some new shortcodes, in particular this one will be helpful

Example

:
[storepage map=”location”]

Experience Add On

append_to_search

When a user typesn the search form address box, \whatever you as the site administrator, adds as text (in quotes after the equal sign) will be appended to the search before it is sent to the map service to get the latitude and longitude of the address they entered.

center_map_at

When this shortcode is used, it will set the default map center on your page in place of the global default in the Store Locator Plus admin panel. If no center map at address set under Experience/Map tab, the default is the center of the map domain you selected.

city

Limits the results to the specified city.

country

hide_map

Number 1 indicates the Hide the map command is on.

initial_results_returned

map_center

Alias for center_map_at.

map_region

Set this as the default region used to influence map searches. A 2-letter country code.

orderby

Sort location results by this location attribute.

show_maptoggle

Show the map on/off switch on the user interface.

state

Limit results to this state.

Power

The Power
add-on
provides added functionality and features for large location lists, SEO management, and categorization of locations.

endicon

[slplus endicon=”http://…/xyz.png”]

homeicon

[slplus homeicon=”http://…/xyz.png”]

only_with_category

[slplus only_with_category=”orange”]

only_with_tag

[slplus only_with_tag=”red”]

tags_for_pulldown

[slplus tags_for_pulldown=”red,green,blue”]

tags_for_dropdown

[slplus tags_for_dropdown=”red,green,blue”]

Alias for tags_for_dropdown

Add Ons That Support This Feature

Buy The Experience Add On
Buy The Experience Add On
Buy The Power Add On
Buy The Power Add On