Perimeter Search
The “Perimeter Search” filter rule (package filter_perimetersearch) filters items
based on their geographic position. Visitors enter an address or coordinates and choose
a search radius; the filter rule finds all items whose geocoordinates (latitude/longitude)
lie within the specified perimeter.
A prerequisite is that items have geocoordinates stored in two separate decimal attributes (latitude and longitude). External lookup services are used for geocoding addresses to coordinates (e.g. OpenStreetMap/Nominatim, Google Maps API).
See also
Detailed documentation on perimeter search: Perimeter Search
Installation
The filter rule is installed via the Contao Manager or Composer:
composer require metamodels/filter_perimetersearch
Settings when Creating the Filter Rule
Setting |
Description |
|---|---|
Type |
Selection of the filter rule type — here: “Perimeter Search”. |
Enabled |
Enables or disables this filter rule. |
Comment |
Free text field for describing the purpose of this filter rule. |
Data mode |
Defines how the geocoordinates of items are stored:
|
URL parameter |
The key of the URL parameter for passing the address/coordinate input. |
Settings for the Frontend Widget
Setting |
Description |
|---|---|
URL parameter |
The key of the URL parameter for passing the filter value. Without input,
the column name of the attribute is used. With |
URL type for the parameter |
Defines whether the parameter is passed as a slug (friendly URL) or as a GET parameter (from MM 2.4) — see SEO |
Label |
Label of the address input field. |
Placeholder |
Placeholder text in the address input field. |
Template (address field) |
Template for the output of the address input field. |
Label (perimeter) |
Label of the perimeter selection widget. |
Template (perimeter) |
Template for the output of the perimeter widget. Default: |
Perimeter mode |
Defines how the search radius is determined:
|
Country mode |
Defines whether and how a country is specified for geocoding:
|
Lookup service |
Configuration of the geocoding service (MCW table):
|
Matching Attributes
The “Perimeter Search” filter rule requires geocoordinates in decimal form:
Decimal (for latitude and longitude separately)
Additionally, the Geo distance attribute can be used for display and sorting by distance.