1

I am getting a Twig runtime error on the below. The map and everything else works when I remove myFieldHandle(params).orderBy('distance').

Error:

Calling unknown method: craft\elements\db\EntryQuery::myFieldHandle()

Code:

{% set target = '90210' %}
{% set params = {
    target: target,
    range: 100
} %}

{% set entries = craft.entries.section('contractors').myFieldHandle(params).orderBy('distance') %}

{% set options = { height: 700, draggable: false, markerInfo: '_includes/mapInfoBubble', infoWindowOptions: { maxWidth: 250 } } %}

Lindsey D
  • 23,974
  • 5
  • 53
  • 110
jeff
  • 11
  • 1

1 Answers1

1

The example of myFieldHandle is just a placeholder for your actual field handle.

So if your Address field has a handle of address, it would look something like this...

{% set entries = craft.entries.section('contractors').address(params).orderBy('distance') %}
Lindsey D
  • 23,974
  • 5
  • 53
  • 110