1

I've got a simple Geofinder form that's working great but we now want to have the results only show specific entries. The entries we want showing are just the ones that have data in a Matrix field.

Is this possible or is there some sort of workaround? I'm stumped on this one. :/

Edit: I should note that it's possible to use a conditional within the Geofinder results tag ({exp:geofinder:location_results}) to simply not display the entries with an empty Matrix field. Like so:

{exp:geofinder:location_results}
  {if my_field}
    {my_field}{data}{/my_field}
  {/if}
{/exp:geofinder:location_results}

What I've found is that this breaks pagination altogether because the count gets all screwed up. We need pagination to work here.

1 Answer 1

1

From memory Geofinder extends the channel:entries tag, so you should be able to use the search parameter to only find those which have a value for 'my_field' - instead of using the conditional inside.

{exp:geofinder:location_results search:my_field="not IS_EMPTY"}
...

That should give you the correct counts etc. hopefully :)

3
  • Per EE docs: "Only fields of the type “Text Input”, “Textarea”, and “Drop-down Lists” are searched with this parameter." To be fair, I haven't tested what you've suggested yet.
    – A Herrera
    Sep 6, 2013 at 17:49
  • I'm pretty sure if you setup the matrix field as searchable it'll populate the native EE field with a value (like '1' from memory) which should work for your 'not IS_EMPTY' rule. Worth a shot :) Sep 6, 2013 at 23:48
  • Unfortunately this didn't quite work. However, it may be that the version of Geofinder we're using is out of date, so I'm not completely ruling this out.
    – A Herrera
    Nov 19, 2013 at 1:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.