Skip to content

Search result tag ​

Show your result from the search_form method.

The tag ​

{exp:reinos_maps_locator:search_result}

Tag Parameters ​

Below are the Tag Parameters. Those parameters can be used in the tag described above

search_id ​

set the search_id hash. This way the module will get this hash instead of using the hash from the url.

search_id="search_id"

sort ​

Order by is by radius, asc or desc. Default asc. Only used with the radius search type.

sort="asc"

sticky_first ​

With yes the locations of sticky entries come first, then the rest by distance. For featured stores, e.g. dealers or flagship stores. Use {if sticky} to show them differently. (from v4.0.0)

sticky_first="no" [OPTIONAL]

limit ​

The number of results per page, default 50. For use with the paging tags https://docs.expressionengine.com/latest/templates/pagination.html

limit="50"

status ​

Set the entry status search. This will override the default that has been set in the {exp:reinos_maps_locator:search_form} tag.

When you want to search for more than one status, use a pipeline | as separator

status="open"

max_radius ​

Available from v4.0.0

The largest radius a search can use, a larger radius (e.g. a changed form field) is cut off at this value. Default: no maximum.

max_radius="250"

distance_decimals ​

Available from v4.0.0

The number of decimals of {distance}. Default 1.

distance_decimals="1"

nearest ​

Available from v4.0.0

When the search has no results, show the nearest N locations instead, regardless of the radius, so a search never ends empty. Use {if nearest} to tell them apart. Default 0 (off).

nearest="5"

filter:field_name ​

Available from v4.0.0

Only the locations of entries with one of these values in a custom field, separate multiple values with a |. Use the short name of the field, add the param once per field: all filtered fields must match. A value matches a whole value of the field, also one of the values of a checkboxes or multi select field; a toggle is 1 or 0. Fields in a Grid or Fluid field can't be filtered.

filter:services="wifi|parking" filter:brand="acme" [OPTIONAL]

filters ​

Available from v4.0.0

With a search in the query string (a search_form with method="get"): the custom fields a visitor can filter on, separate multiple fields with a |. Add checkboxes with the name filter[field_name][] to your form, e.g. <input type="checkbox" name="filter[services][]" value="wifi">. Only the fields of this param are used. A filter:field_name param of the tag can't be changed by a visitor.

filters="services|parking" [OPTIONAL]

filter_field ​

Available from v4.0.0

The name of the filters in the query string. Default filter.

filter_field="filter" [OPTIONAL]

category_match ​

Available from v4.0.0

How the selected categories of the search are matched: all (a location must be in all of them) or any (in one of them). Default all.

category_match="any"

show_expired ​

Available from v4.0.0

Also return the locations of expired entries. Default no.

show_expired="yes"

show_future_entries ​

Available from v4.0.0

Also return the locations of entries with an entry date in the future. Default no.

show_future_entries="yes"

Tag Parameters for a search in the query string ​

Available from v4.0.0

Used for a search from a search form with method="get" (see Shareable searches). A search ID in the URL goes first.

channel ​

The channels to search in (required), separate with a pipeline (|) for multiple channels.

channel="stores"

metric ​

km (default) or mile (also mi or miles).

metric="km"

radius ​

The radius when the visitor didn't choose one. Default 100.

radius="25"

location_field, radius_field_max, search_type_field, search_category_field ​

The names of the fields of the search form, the same as on the search_form tag. Default location_field, radius_field_max, search_type_field and search_category_field.

location_field="location"

Tag Parameters DEFAULT ​

Available from v3.2.0

Below is a set of params that can be used when you need to show some default entries, before the user has done a search.

(If it returned no result, it will not trigger the no_result catch block)

default:show_all ​

Enable or disable the default results

default:show_all="no"

default:channel ​

Give the channel(s) to search. separate with a pipeline (|) for multiple channels. Required for the default results.

default:channel="channel_1|channel_2"

default:location ​

Enter a location/address from where the search is started.

default:location="new-york"

default:metric ​

set the type of metrics km or mile. Default km.

default:metric="km"

default:search_type ​

Set the search type: radius, locality, admin_level or sub_locality. Default radius.

default:search_type="radius"

default:radius ​

The radius to search within, in the given default:metric. Default 100.

default:radius="1000"

Tag Variables ​

Below are the Tag Variables. Those Variables can be used inside the tag described above.

entry_id ​

{entry_id}

lat ​

{lat}

lng ​

{lng}

field_id ​

The ID of the field the location is saved from

{field_id}

channel_id ​

{channel_id}

Calculated radius ​

The distance between the searched location and this location (only with the radius search type)

{radius}

distance ​

Available from v4.0.0

{radius} rounded to distance_decimals (default 1), with the unit in {distance_unit}

{distance} {distance_unit}

distance_unit ​

Available from v4.0.0

km or mi, the unit of {distance}

{distance_unit}

title ​

Available from v4.0.0

The title of the entry

{title}

url_title ​

Available from v4.0.0

{url_title}

entry_date ​

Available from v4.0.0

The entry date, with the date formatting of ExpressionEngine

{entry_date format="%Y-%m-%d"}

expiration_date ​

Available from v4.0.0

The expiration date (0 without one), with the date formatting of ExpressionEngine

{expiration_date format="%Y-%m-%d"}

nearest ​

Available from v4.0.0

true when the results are the nearest locations because the search had no results (see the nearest parameter).

{if nearest && count == 1}No locations within {post_radius} km, these are the nearest:{/if}

Posted radius by the user ​

{post_radius}

admin_level_n:name ​

indicates the number of order civil entity below the country level. Within the United States, these administrative levels are states. Not all nations exhibit these administrative levels.

{admin_level_1:name} // prints the first admin level, for the US this is the state
{admin_level_2:name} // prints the second admin level, for the US this is the county

admin_level_n:code ​

The code of the admin level, for example CA for California.

{admin_level_1:code}

city ​

{city}

street_name ​

{street_name}

street_number ​

{street_number}

postal_code ​

{postal_code}

country ​

{country}

country_code ​

{country_code}

current_count ​

Available from v3.3.0

The number of the current result on this page

{current_count}

total_count ​

Available from v3.3.0

The number of results on this page

{total_count}

abs_total_count ​

Available from v3.3.0

The total number of results of the search (over all pages)

{abs_total_count}

Example ​

{!-- include the Maps module and show a default map with the center on holland and a max zoom of 15 --}
{!-- (otherwise the zoom would be max when placing the markers)--}
{exp:reinos_maps:html_header}
{exp:reinos_maps:map center:address="holland" zoom:max="15" fit_map:markers="yes"}

{exp:reinos_maps_locator:search_result}
    {if no_results}
        No result
    {/if}

    entry_id: {entry_id}<br>
    radius: {radius}<br>
    lat: {lat}<br>
    lng: {lng}<br>
    city: {city}<br>
    street_name: {street_name}<br>
    street_number: {street_number}<br>
    postal_code: {postal_code}<br>
    country: {country}<br>
    country_code: {country_code}<br>

    {!-- Data from the native maps_locator fieldtype --}
    {exp:channel:entries dynamic="no" entry_id="{entry_id}"}
        {maps_locator_test}
            address: {maps_locator_test:address}<br>
            postal_code: {maps_locator_test:postal_code}<br>
            city: {maps_locator_test:city}<br>
            country: {maps_locator_test:country}<br>
        {/maps_locator_test}
    {/exp:channel:entries}

    {!-- place markers with the Maps module --}
    {maps:add_marker latlng="{lat},{lng}"}

{/exp:reinos_maps_locator:search_result}
{/exp:reinos_maps:map}

{exp:reinos_maps:html_footer}