Search Tag

The Search tag is the primary tag that you will use to display the store locator search form and results.

Example

Let's look at a basic Search tag example.

Parameters

search_type

search_type="radius"

This parameter determines the type of search that will be performed. When set to "radius", the query will return results based on the distance from the address specified by the user. When set to "match", the query will return results that match fields in the database for each store.

Possible Values

  • search_type="radius" — search by distance (default)
  • search_type="match" — wildcard matching

default

default="show_all"

This parameter allows you to set a default for when a user first comes to the page. When set to "show_all", all of the results will be listed until a user searches for a specific location.

Possible Values

  • default="show_all"

default_sort

default_sort="city"

This parameter allows you to set a default sort parameter when you are using default="show_all".

Possible Values

  • default_sort="name"
  • default_sort="city"
  • default_sort="state"
  • default_sort="address_line1"
  • default_sort="address_line2"
  • default_sort="country"
  • default_sort="postal_code"
  • default_sort="custom_field1"
  • default_sort="custom_field2"
  • default_sort="custom_field3"
  • default_sort="custom_field4"
  • default_sort="custom_field5"
  • default_sort="custom_field6"
  • default_sort="custom_field7"
  • default_sort="custom_field8"
  • default_sort="custom_field9"
  • default_sort="custom_field10"

default_order

default_order="asc"

This parameter allows you to set a default sort order parameter when you are using default="show_all". Used in conjunction with the "default_sort" parameter.

Possible Values

  • default_order="asc"
  • default_order="desc"

Single Variables

address

{address}

The address provided by the user if there is one.

city

{city}

The city provided by the user if there is one.

state

{state}

The state provided by the user if there is one.

postal_code

{postal_code}

The postal code provided by the user if there is one.

country

{country}

The country provided by the user if there is one.

radius

{radius}

The radius provided by the user if there is one.

unit

{unit}

The unit of distance used for radial searches.

absolute_results

{absolute_results}

This variable will always display the absolute total number of results that are returned by the tag, regardless of pagination.

per_page

{per_page}

The number of results displayed per page when using pagination.

Variable Pairs

id

{id}

The unique id of the store.

name

{name}

The name of the store.

address_line1

{address_line1}

The first line of the store's address.

address_line2

{address_line2}

The second line of the store's address.

city

{city}

The city that the store resides in.

state

{state}

The state that the store resides in.

postal_code

{postal_code}

The postal code that the store resides in.

country_abbr

{country_abbr}

The two-character abbreviation of the country that the store resides in.

country_name

{country_name}

The full name of the country that the store resides in.

latitude

{latitude}

The latitudinal coordinate of the store.

longitude

{longitude}

The longitudinal coordinate of the store.

distance

{distance}

The distance from the user's location to the store.

description

{description}

The description of the store.

url

{url}

The url of the store.

phone

{phone}

The phone number of the store.

fax

{fax}

The fax number of the store.

directions_url

{directions_url}

A URL for displaying driving directions to the store.

count

{count}

The "count" out of the current entries being displayed. If five entries are being displayed, then for the fourth entry the "{count}" variable would have a value of "4".

custom_field1

{custom_field1}

The custom value for this store.

custom_field2

{custom_field2}

The custom value for this store.

custom_field3

{custom_field3}

The custom value for this store.

custom_field4

{custom_field4}

The custom value for this store.

custom_field5

{custom_field5}

The custom value for this store.

custom_field6

{custom_field6}

The custom value for this store.

custom_field7

{custom_field7}

The custom value for this store.

custom_field8

{custom_field8}

The custom value for this store.

custom_field9

{custom_field9}

The custom value for this store.

custom_field10UA-27515284-1

{custom_field10}

The custom value for this store.

Pagination

The Search tag provides the ability to paginate the search results.