Skip to content

Fieldtype template tag ​

To get the location values from your entry. The address values are the values entered in the field; lat and lng come from the saved (geocoded) location, so they can differ from the entered coordinate and are empty when the location could not be geocoded.

Example ​

{exp:channel:entries dynamic="no" entry_id="2"}
    {your_field_type_name}
        address: {your_field_type_name:address}<br>
        postal_code: {your_field_type_name:postal_code}<br>
        city: {your_field_type_name:city}<br>
        country: {your_field_type_name:country}<br>
        lat: {your_field_type_name:lat}<br>
        lng: {your_field_type_name:lng}<br>
    {/your_field_type_name}
{/exp:channel:entries}

Tag Variables ​

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

address ​

{your_field_type_name:address}

postal_code ​

{your_field_type_name:postal_code}

city ​

{your_field_type_name:city}

country ​

{your_field_type_name:country}

state ​

{your_field_type_name:state}

lat ​

{your_field_type_name:lat}

lng ​

{your_field_type_name:lng}

Field settings ​

Select how an user is able to set the location ​

Available from v3.1.0

Based on this choice, the field shows the address input fields, the latlng input fields or both. Possible values are Address and LatLng, Address or LatLng. When both are shown and you enter a latlng coordinate, the coordinate is used in favor of the address.

The fieldtype requires the Maps module to be installed and can be used in channel fields (not in a Grid).