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

sort="asc"

limit

For use with the paging tags https://docs.expressionengine.com/latest/templates/pagination.html

limit=""

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"

Tag Parameters DEFAULT

Below is a set of params that can be used when you need to show some default entries.

(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.

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:metric="km"

default:search_type_field

Set the search type field, that hold the values. radius locality admin_level sub_locality

default:search_type_field=""

default:radius

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}

Calculated radius

{radius}

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 us this is the state
{admin_level_2:name} // prints the second admin level, for us this is the state

city

{city}

street_name

{street_name}

street_number

{street_number}

postal_code

{postal_code}

country

{country}

country_code

{country_code}

absolute_results

{absolute_results}

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:maps:map address:center="holland" max_zoom="15"}

{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 map:id="1" latlng="{lat},{lng}" fit_map="yes"}

{/exp:reinos_maps_locator:search_result}

{exp:reinos_maps:html_footer}