Skip to content

Direction/Route Tag ​

Return multi-part directions for a series of waypoints. Directions for several modes of transportation are available.

The route is fetched from the route provider that is set in the Maps module (see CP overview). The tag data is repeated for every leg of the route. Every waypoint is a stop, so a route with two waypoints has three legs. When no route is found, the {if no_results} conditional is shown. See How it works for the full flow and which parameters the providers actually use.

The tag ​

{exp:reinos_maps:route}

Tag parameters ​

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

address:from ​

A from address name, can also a name like 'reichenbach im vogtland or amsterdam or america'.

address:from="" [REQUIRED] if latlng:from is empty

latlng:from ​

latitude longitude coordinates

latlng:from="" [REQUIRED] if address:from is empty

address:to ​

A to address name, can also a name like 'reichenbach im vogtland or amsterdam or america'.

address:to="" [REQUIRED] if latlng:to is empty

latlng:to ​

latitude longitude coordinates

latlng:to="" [REQUIRED] if address:to is empty

address:waypoints ​

Stops between the from and to point. Addresses separated with a pipeline '|'

address:waypoints="" [OPTIONAL] if latlng:waypoints is empty

latlng:waypoints ​

Stops between the from and to point. Latitude longitude coordinates separated with a pipeline '|'

latlng:waypoints="" [OPTIONAL] if address:waypoints is empty

optimize_waypoints ​

Let the route provider reorder the waypoints to get a better and optimized route. Set it to no to keep the waypoints in the order you requested them.

Note: Bing Maps doesn't optimize the waypoints of a transit route.

optimize_waypoints="yes" [OPTIONAL]

travel_mode ​

set the travel mode.
values: driving walking cycling (Google Maps, OpenRouteService and OSRM, from v5.0.0) transit (Google Maps and Bing Maps) wheelchair (OpenRouteService, from v5.0.0)

travel_mode="driving" [OPTIONAL]

avoid ​

values: tolls highways ferry
You can use multiple options separated with a pipeline (|)

avoid="tolls" [OPTIONAL]

lang ​

Set the language based on the language code

Note: Bing Maps expects a culture code, for example nl-NL.

lang="en" [OPTIONAL]

unit ​

Set the unit of the distances.
values: km mi

unit="km" [OPTIONAL]

prefix ​

Set the prefix of the tag variables.

prefix="direction:" [OPTIONAL]

Tag variables ​

Below are the Tag variables. (note the prefix direction:, which can be changed with the prefix parameter)

The tag gives one row per leg: a route with waypoints has a leg from every stop to the next one, so the tag data is shown once per leg. Use {count} and {total_results} for the leg number, and the total_ variables for the whole route.

direction:distance ​

The distance

{direction:distance}

direction:duration ​

The duration/time

{direction:duration}

direction:start_location ​

The start location

{direction:start_location}

direction:end_location ​

The end location

{direction:end_location}

direction:distance:meters ​

The distance of the leg as a number: in meters, or in kilometers or miles with one decimal (from v5.0.0)

{direction:distance:meters} {direction:distance:km} {direction:distance:mi}

direction:duration:seconds ​

The duration of the leg as a number: in seconds or in whole minutes (from v5.0.0)

{direction:duration:seconds} {direction:duration:minutes}

direction:total_distance ​

The distance of the whole route (all legs), e.g. 110.4 km, in the unit of the tag. As a number with :meters, :km or :mi (from v5.0.0)

{direction:total_distance} {direction:total_distance:km}

direction:total_duration ​

The duration of the whole route (all legs), e.g. 2 h 39 min. As a number with :seconds or :minutes(from v5.0.0)

{direction:total_duration} {direction:total_duration:minutes}

direction:steps ​

The steps pair tag hold all the steps to on the route

{direction:steps}...{/direction:steps}

direction:steps:distance ​

The distance

{direction:steps}
    {direction:steps:distance}
{/direction:steps}

direction:steps:duration ​

The duration/time

{direction:steps}
    {direction:steps:duration}
{/direction:steps}

direction:steps:location ​

The location where the action should take

{direction:steps}   
    {direction:steps:location}
{/direction:steps}

direction:steps:instruction ​

Instructions of the step, as text. (Before v5.0.0 Google Maps gave HTML, e.g. <b>.)

{direction:steps}   
    {direction:steps:instruction}
{/direction:steps}

direction:steps:instruction:plain ​

The instruction of the step without HTML (from v5.0.0)

{direction:steps}
    {direction:steps:instruction:plain}
{/direction:steps}

direction:steps:distance:meters ​

The distance and duration of the step as a number: {direction:steps:distance:meters} and {direction:steps:duration:seconds} (from v5.0.0)

{direction:steps}
    {direction:steps:distance:meters} {direction:steps:duration:seconds}
{/direction:steps}

direction:steps:travel_mode ​

The travel mode

{direction:steps}
    {direction:steps:travel_mode}
{/direction:steps}