0

We are currently working Sitecore 9.0.2 with SXA 1.8.1

I have a list of items(for example postcodes in London) inherits IPOI template.

Content

  • Home

  • PW1 - Latitude = xxx , Longitude = xxx

  • W1 - Latitude = xxx , Longitude = xxx
  • EY1 - Latitude = xxx , Longitude = xxx

I have added an SXA location finder and search results components on my page.

Problem: I select London in the location finder I want search results to populate all the 3 items as they are in london , at the moment it displays Zero results , Can i achieve this functionality OOTB with SXA Search components , if not an approach on how to solve? it would be great.

1 Answer 1

1

You are mixing things here a little bit. The Location Finder rendering is used to find a location. When you will put a "London" there is will go to Google and ask for the location for "London". After that, it will update the hash with an additional g parameter which will save that location. Later on, that location can be used to:

  • search within a radius of e.g. 10 kilometres from that point
  • sort results by distance from that point

So basically Location Finder translates the name of a location to geographical point (latitude and longitude).

What you are asking is more like a Search Box functionality. You put a word, like a city name (in that case "London") and you want to see points in that point. If your POI items would have for example Location text field, you can use Search Box to search for the content but that is not what you are aiming for.

The functionality which you are asking for - as far as I'm understanding it correctly - is not available out of the box.

You would need to implement custom logic which will:

  1. Translate name of the city to a polygon - get the city boundaries
  2. Check if any of your items are inside of those boundaries
  3. Display only those items

That is not a trivial task but achievable!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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