Support » Plugin: Events Manager » How to add filtered [events_map] to the events page?

  • Resolved oelti


    Hello guys,

    I try to figure out how to add the [events_map] to the events page, which shows only the results which is also shown in the result list of the events?

    First I added a new block to the events page with the [events_map] shortcut. The map appears with all created events as a dot. Fine…

    Now I use the events search form and query an event. The result list shows the result, but the [events_map] shows still all created events 🙁

    Then I was searching in the help how to use the [events_map] and found out that I can add attributes to the shortcut. But unfortunetely there is no attribute telling the events_map to use the search-query.

    The goal is “very simple”. An event page with a query form, a google map which shows the events on the map and under the map the results. The events list and the map can be filtered by the search form.

    So simple question to the community: What I miss to solve the problem?

    Thanks a lot!

    So long

Viewing 4 replies - 1 through 4 (of 4 total)
  • Patrick


    Hi Stefan,
    It’s not “very simple”. The two things you are talking about work completely separate from each other and in different ways…

    The search query is triggered (via Ajax) from the front-end (by the visitor). The [events_map] shortcode and its arguments are ‘hard’ coded in the back-end.

    So you would need to hook into the Ajax Search, making it not output an events list, but trigger a new function to create a multi-marker map using those search results entered by the visitor. It’s not impossible, but you’ll need experienced custom coding.



    Also… By default EM does not fetch any coordinates using the Ajax Search.
    So you would either have to alter that (loosing those changes when EM is updated) or create a new Ajax Search form and out from scratch.



    Hey Patrick,

    thank you for your reply.

    I see that we need more programming to solve the problem and it is not “very simple” and out of the box usable.

    I think, in this case, I will plan it in the next phase, because it is not so important for the user on a functional view.

    I think we will add in the response of the ajax the gps coordinates and update the map clientside – what you think?

    Have a nice day!

    So long

    Plugin Support angelo_nwl


    you can also try to hook into em_locations_get filter; for reference, you can see this filter under classes/em-locations.php

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.