• Hi, I have an installation of Events Manager and Events Manager Pro. One of my users asked if he could search for past events. I fiddled with the settings under Pages and set the default event scope under “default event list options” to “all events”. Sure enough all events appear in the event list. However that’s not a solution that would work for the majority of users who only want to see future events. I tried unsetting the Events page so that event archives would be activated, but that didn’t work. Viewing the default event list url as described in the settings just gave a blank page, so I couldn’t see future OR past events.

    Is there a simple way to split event display into two different pages, one for future, one for all events?

    Thanks

    Nick

Viewing 4 replies - 1 through 4 (of 4 total)
  • On another page use the following shortcode:

    [events_list scope="all"]
    Thread Starter ncarring

    (@ncarring)

    Brilliant, that works! Thank you!

    Would it be possible to add filter capabilities? I tried adding [event_search_form] above the other shortcode, and it works, sort of, except it then uses the normal events page to display the results, so we’re back to future events only.

    • This reply was modified 2 weeks, 5 days ago by ncarring.

    Unfortunately, there’s no way to add a search form with the events_list shortcode. You can add a search form with the events_calendar shortcode but there’s no way to change the default view with the events_calendar shortcode.

    [events_calendar show_search=1 has_search=1 views=calendar,list,grid,list-grouped scope="all"]

    Here’s a way to create a page with filtering. First create the directory wp-content/plugin-templates/events-manager/templates and then create a file in that directory called events-search.php with the following content:

    <script>
    jQuery(document).ready( function($){
    $(window).on('load', function() {
    $('.em-search-submit').click();
    });
    });
    </script>
    <?php
    /* @var $args array */
    $args['scope'] = 'all';
    $args['search_action'] = 'search_events';
    $args['search_url'] = get_option('dbem_events_page') ? get_permalink(get_option('dbem_events_page')):EM_URI;
    $args['css_classes'][] = 'em-events-search';
    $args['css_classes_advanced'][] = 'em-events-search-advanced';
    em_locate_template('templates/search.php', true, array('args'=>$args));
    ?>

    Then use the following shortcode on the page where you want all events to be displayed:

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