Event Manager Pro – Global Map Search
-
Hello Marcus,
Awesome plugin!
Hoping you can help me. When I do a search on my Event’s page I get a list of events but the global map does not change to the locations found. Can you please help me achieve this?Thank you,
Kyle
-
Hi,
do you have a sample link for us to see and analyze? also, just to narrow down the problem have you tried to temporarily:
– deactivating all other plugins to see if this resolves the problem. If this works, re-activate the plugins one by one until you find the problematic plugin(s).
– switching to the default theme to rule out any theme-specific problemsHello,
Thanks for the reply.
I am currently building the wordpress site using MAMP, so it’s a local website. This means I am unable to supply you with a link at this time.
I have tried it with the basic twenty twelve theme and no luck either. I then tried de-activating the plugins, but no luck either.
The shortcode I am using on my events page for the map is [locations_map]
Is this the correct code?
Many thanks for your help!
the search form doesn’t integrate with the maps automatically, you’d need to code in the locations map and supply the function with the post variables from the search form using the em_get_locations_map_shortcode($args) function
Hi Marcus,
I’m sorry to be a pain but I’m new to this. Where do I insert this code?
Many thanks
see templates/templates/events_list.php
copy that first to yourtheme/plugins/events-manager/templates/ and edit the file there
just tested this and it’s easier than I though. try adding this e.g. at the top of that file:
echo em_get_locations_map_shortcode($_REQUEST);
Marcus, your a legend.
Thanks for your help, I’ll let you know how I get on!
Sorry, still won’t work. I moved the template file into your theme/plugins/events-manager/templates and inserted the code in, cleared my cache but still no luck. Here is my code…
<?php /* * Default Events List Template * This page displays a list of events, called during the em_content() if this is an events list page. * You can override the default display settings pages by copying this file to yourthemefolder/plugins/events-manager/templates/ and modifying it however you need. * You can display events however you wish, there are a few variables made available to you: * * $args - the args passed onto EM_Events::output() * * echo em_get_locations_map_shortcode($_REQUEST); */ if( get_option('dbem_events_page_search') && !defined('DOING_AJAX') ){ em_locate_template('templates/events-search.php',true); } //TODO fine tune ajax searches - we have some pagination issues otherwise, due to search querystrings if( get_option('dbem_events_page_ajax', (defined('EM_AJAX_SEARCH'))) ) echo "<div class='em-events-search-ajax'>"; $events_count = EM_Events::count( apply_filters('em_content_events_args', $args) ); $args['limit'] = get_option('dbem_events_default_limit'); $args['page'] = (!empty($_REQUEST['pno']) && is_numeric($_REQUEST['pno']) )? $_REQUEST['pno'] : 1; if( $events_count > 0 ){ //If there's a search, let's change the pagination a little here if(!empty($_REQUEST['action']) && $_REQUEST['action'] == 'search_events'){ $args['pagination'] = false; if(get_option('dbem_event_list_groupby') ){ $args['mode'] = get_option('dbem_event_list_groupby'); $args['date_format'] = get_option('dbem_event_list_groupby_format'); echo em_events_list_grouped($args); }else{ echo EM_Events::output( $args ); } //do some custom pagination (if needed/requested) if( !empty($args['limit']) && $events_count > $args['limit'] ){ //Show the pagination links (unless there's less than $limit events), note that we set em_search instead of search to prevent conflicts $search_args = array_merge(EM_Events::get_post_search(), array('pno'=>'%PAGE%','action'=>'search_events','search'=>null, 'em_search'=>$args['search'])); $page_link_template = em_add_get_params($_SERVER['REQUEST_URI'], $search_args, false); //don't html encode, so em_paginate does its thing echo apply_filters('em_events_output_pagination', em_paginate( $page_link_template, $events_count, $args['limit'], $args['pno']), $page_link_template, $events_count, $args['limit'], $args['pno']); } }else{ if(get_option('dbem_event_list_groupby') ){ $args['mode'] = get_option('dbem_event_list_groupby'); $args['date_format'] = get_option('dbem_event_list_groupby_format'); echo em_events_list_grouped($args); }else{ echo EM_Events::output( $args ); } } }else{ echo get_option ( 'dbem_no_events_message' ); } if( get_option('dbem_events_page_ajax', (defined('EM_AJAX_SEARCH'))) ) echo "</div>";
Not sure what I am doing wrong, please help!
I’m guesssing you took this question to the pro forums…
if not, the problem is you’ve got
echo em_get_locations_map_shortcode($_REQUEST);
in the wrong place, paste it e.g. after the line with the */
also, for you and others, this doesn’t mean the search text field will work, because what this does is take the search attributes supplied by the form and passes it onto the shortcode function, which accepts some things (e.g. scope, category, location, etc.) but not search (i.e. text search)
https://wp-events-plugin.com/documentation/event-search-attributes/
- The topic ‘Event Manager Pro – Global Map Search’ is closed to new replies.