Results Layout

You can change the way the list of locations is rendered by updating the Results Layout setting under the Experience tab of Store Locator Plus. It appears in the Results panel when you have the Experience add-on installed.

Results Layout determines how the location data is rendered below the map.   It is a combination of basic HTML and Store Locator Plus short codes that are loaded into your locator page when the page is first rendered on the screen.  The Results Layout will vary depending on the SLP Plugin style selected   When a location search is performed, either automatically via “immediate mode” or when a user enters an address, the returned results are formatted using the Results Layout and displayed in the results section below the map.

Changing The Setting

The Results Format setting is a text entry that appears under the Store Locator Plus Experience tab in the Results Section.

Default Format

The default format for the results string uses the numerical encoding for the various data elements that can be rendered. This is the default string format that is present in the base Store Locator Plus plugin. You can reset the string to the default at any time by deleting the entry in the Results Layout admin field and saving the settings.


<div id="slp_results_[slp_location id]" class="results_entry [slp_location featured]">

<div class="results_row_left_column" id="slp_left_cell_[slp_location id]" >
            <span class="location_name">[slp_location name]</span>
            <span class="location_distance">[slp_location distance_1] [slp_location distance_unit]</span>
        </div>


<div class="results_row_center_column" id="slp_center_cell_[slp_location id]" >
            <span class="slp_result_address slp_result_street">[slp_location address]</span>
            <span class="slp_result_address slp_result_street2">[slp_location address2]</span>
            <span class="slp_result_address slp_result_citystatezip">[slp_location city_state_zip]</span>
            <span class="slp_result_address slp_result_country">[slp_location country]</span>
            <span class="slp_result_address slp_result_phone">[slp_location phone]</span>
            <span class="slp_result_address slp_result_fax">[slp_location fax]</span>
        </div>


<div class="results_row_right_column" id="slp_right_cell_[slp_location id]" >
            <span class="slp_result_contact slp_result_website">[slp_location web_link]</span>
            <span class="slp_result_contact slp_result_email">[slp_location email_link]</span>
            <span class="slp_result_contact slp_result_directions"><a href="http://[slp_option map_domain]/maps?saddr=[slp_location search_address]&daddr=[slp_location location_address]" target="_blank" class="storelocatorlink">[slp_location directions_text]</a></span>
            <span class="slp_result_contact slp_result_hours">[slp_location hours]</span>
            [slp_location pro_tags]
            [slp_location iconarray wrap="fullspan"]
            [slp_location eventiconarray wrap="fullspan"]
            [slp_location socialiconarray wrap="fullspan"]
            </div>

    </div>

* Results Layout Shortcodes

The Results Layout is a combination of HTML and special shortcodes that are only active when rendering locations.  Display a specific location field, such as a store name, or a location data element, such as a calculated distance, in the given location in the results layout.   Location fields are data taken directly from the location data table.   Data elements are calculated in the JavaScript interface after “talking to” the locations database and the location search form.

slp_location shortcodes (base plugin)

You can output a single field with the [slp_location <location_data>] shortcode in the results layout.

[slp_location address]

Display the street address.

[slp_location address2]

Display the second line of the street address.

[slp_location city]

Display the city.

[slp_location city_state_zip]

The city followed by the state followed by the zip with USA-style formatting.   If the city and state are not blank a comma is inserted between the two.   The zip is at the end with a space before it if either city or state are not blank.

[slp_location country]

Display the country.

[slp_location description]

Display the description.

[slp_location distance]

The distance between the center of the map, the user-entered zip or address, and the location being returned.

[slp_location email]

Display the email.  This is not clickable just the raw email.  You will likely want to use email_link from the Experience add-on instead.

[slp_location fax]

The fax number.

[slp_location fax_with_label]

The fax results label as set in the results/label panel followed by the fax location data field.

[slp_location hours]

The raw hours text, not HTML sanitized.

[slp_location hours_sanitized]

The hours text field with all special characters decoded using JavaScript text formatting.

[slp_location id]

Display the location number.

[slp_location image]

The raw image field content.  You’ll likely want to wrap this in an HTML <img src=”…”> tag.

[slp_location lat]

Display the latitude.

[slp_location lng]

Display the longitude.

[slp_location location_address]

The complete address for the location. A combined address, address 2, city, state, zip, country string.

[slp_location name]

Display the location name.

[slp_location neat_title]

The neat title field.

[slp_location phone]

The phone number.

[slp_location phone_with_label]

The phone results label as set in the results/label panel followed by the phone location data field.

[slp_location search_address]

The address or zip code the user entered in the search box to perform a search.

[slp_location state]

Display the state.

[slp_location url]

Display the url.  This is not clickable just the raw url.  You will likely want to use web_link or url_link instead.

[slp_location url_link]

Display the url in a clickable link.  Displays the full URL instead of the website label.  Use web_link if you prefer the website label.  The website label can be changed with the Experience add-on.

[slp_location web_link]

This will be the location URL from the location database OR a link to the Store Pages web page if “pages replace website” is enabled in Store Pages.   The text will be the website label text, usually “website”.

[slp_location zip]

Display the zip or postal code.

[slp_location data.sl_distance]

Display the raw long-form calculated distance as a floating-point number.

[slp_location data.last_updated]

Display the timestamp for then the location was last updated.

slp_location shortcodes (Experience)

[slp_location email_link]

The anchor tag and email address from the data field to form a direct email link. If the “use email form” setting is turned on a pop-up email form will be used instead of a direct email link.

[slp_location featured]

Will return the next “featured” if the location is checked off as featured.  Useful for setting HTML span or div classes for styling.

[slp_location icon]

Return the icon for the primary category assigned to this location via Tagalong.

[slp_location rank]

Output the sort rank for the location.

[slp_location data.marker]

Output the raw per-location marker setting.  You will like want to put this in a HTML image src tag like <img src=”[slp_location data.marker]” />.

[slp_location exdata.featured]

Output the featured status as a “1” or “0” string.  Useful for JavaScript triggers.

slp_location shortcodes (Extended Data Manager)

[slp_location data.<slug>]

Replace <slug> with the field slug as shown under the Extended Data Manager interface.  You will find the slugs under the General tab , Extended Data Manager sub-tab.

For example, if I add a field named “Has Donuts” to my location data, EDM will default to using the slug “has_donuts”.    The shortcode [slp_location data.has_donuts] will output whatever is stored in that field.   If you use a boolean data type the value will be 1 or 0 will be output.

slp_location shortcodes (Pro Pack)

[slp_location pro_tags]

The Pro Pack tags in a formatted div based on the settings in the Pro Pack tags output settings.

slp_location shortcodes (Tagalong)

[slp_location categories]

A list of assigned Tagalong category IDs.

[slp_location category_count]

Count of categories assigned to the location.

[slp_location category_names]

A comma-separated list of the category names assigned to the location. The Premier add-on allows you to replace the comma with any string as a separator including things like the HTML br (newline) separator.

slp_location shortcodes (Contact Extender)

[slp_location first_name]

This will show first name in results.

[slp_location last_name]

This will show last name in results.

slp_location Output Modification

You can change the way the location data is rendered in the results with various shortcode attributes.   Shortcode attributes come after the field/location data part of the shortcode but before the closing square bracket.  There are a few additional attributes that you can use with a field to help with the formatting of the display results.

[slp_location <location_data> format=decimal1]

Format the field or data element, typically distance, as a floating point number with 1 position after the decimal.

Example:
[slp_location distance format decimal1]

[slp_location <location_data> format=sanitize]

Replace any special characters and whitespace  (space, tab, etc.) with _.

Example:
<div class=”[slp_location tags format sanitize]”>[slp_location tags]</div>

[slp_location <location_data> format=text]

Format the field or data element using JavaScript text formatting.   JS text formatting will attempt to convert special characters and encoded HTML entities into a user-friendly display format.

Example:
[slp_location hours format text]

[slp_location <location_data> raw]

Output the data element or field without stripping out special HTML characters.  Especially useful for data elements that are processed in JavaScript.

Example:
[slp_location email_link raw]

[slp_location <location_data> suffix=”br”]

Output a <br/> tag after the field data if the field is not empty.

[slp_location <location_data> suffix=”comma”]

Output a comma after the field data if the field is not empty.

[slp_location <location_data> suffix=”comma_space”]

Output a comma and space after the field data if the field is not empty.

Example:
[slp_location city suffix comma_space]
[slp_location state suffix space]
[slp_location zip]

[slp_location <location_data> suffix=”space”]

Output a space after the field data if the field is not empty.

Example:
[slp_location city suffix comma_space]
[slp_location state suffix space]
[slp_location zip]

[slp_location <location_data> wrap=”img”]

Make the field data the source part of an image tag.    Output will be <img src=”<field-data>” class=”sl_info_bubble_main_image”>

[slp_location <location_data> wrap=”mailto”]

Make the field data the source part of an anchor mailto tag.    Output will be <a href=”mailto:<field-data>” id=”slp_marker_email” class=”storelocatorlink”>

[slp_location <location_data> wrap=”website”]

Make the field data the source part of an anchor.    Output will be <a href=”<field-data>” target =”_self|_blank” id=”slp_marker_website” class=”storelocatorlink”>

slp_option shortcodes (Experience)

Display a Store Locator Plus option setting in the results output.

Example:
[slp_option distance_unit]

Attributes

There are a few additional attributes that you can use with a field to help with the formatting of the display results.

ifset=”<field_slug>”

Only output the specified option if the noted field contains a value.

wrap=”directions”

Wrap the specified option, usually “label_directions” (the text for the directions) in an anchor (a href) tag that links to the Google directions page.

 

html br | closing_anchor [ifset <field_slug>]

[box type=”info”] With Enhanced Results (Legacy) or Experience Add-on[/box]

Display the specified HTML output type when warranted. This will output a break tag or a closing anchor tag in the results output. Typically used with the ifset modifier to only output a br or anchor close if the noted field contains data.

Attributes

There are a few additional attributes that you can use with a field to help with the formatting of the display results.

ifset=”<field_slug>”

Only output the specified option if the noted field contains a value.

Example:
[slp_location web_link wrap website]
[slp_option label_website ifset web_link]
[ html closing_anchor ifset web_link ]

 

Curly Braces

Why are you seeing numbers in curly braces on your Results Layout?    You have most likely upgraded from an older installation of Store Locator Plus.  The old-style numeric placeholders are no longer supported.   Use the Janitor add-on and delete the Enhanced Results and Experience add-on “Results String” or “Results Layout” settings to reset them to the SLP 4.4 style default layout.