did you also try to check the EM templates for events list?
did you also try to check the EM templates for events list?
I’m using custom templates, yes, but I don’t quite understand what you’re trying to tell me…
I tried the following:
if ( empty($_GET['scope'])) {
if ( empty($_GET['lang'])) {
echo '<a href="?scope=past">Vergangene Veranstaltungen</a>';
} else {
echo '<a href="?lang=en&scope=past">past events</a>';
}
}
ensuring compatibility with qtranslate,
and in the events list template:
if( !empty($_GET['scope']) ) {
$args['scope'] = $_GET['scope'];
}
which works! (yay), but only if you put that code *before* the
$events = EM_Events::get( apply_filters('em_content_events_args', $args) );
which is curious, since other variables, such as limit and page get altered *after* $events is populated:
$args['scope'] = $_GET['scope'];
$events = EM_Events::get( apply_filters('em_content_events_args', $args) );
$args['limit'] = get_option('dbem_events_default_limit'); //since we are passing this info to an output function or template, we should get all the events first
$args['page'] = (!empty($_REQUEST['page']) && is_numeric($_REQUEST['page']) )? $_REQUEST['page'] : 1;
you could also use a filter like em_events_get or another hook to change the scope before the search occurs, then you just need a get variable (or extra endpoint if you know what you’re doing and want to be fancy). the tutorials probably can explain both