• Resolved DonSailieri

    (@donsailieri)


    Hi πŸ™‚

    this is what I’m trying to do:

    On my default events list page, I want to use an <a href="???">past events</a> that basically reloads the page and only shows certain (in this case, past) events.

    I realize I could do this with shortcodes, but for theme-related reasons, this can’t be a separate page.

    Any thoughts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • did you also try to check the EM templates for events list?

    Thread Starter DonSailieri

    (@donsailieri)

    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…

    Thread Starter DonSailieri

    (@donsailieri)

    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;
    Plugin Author Marcus (aka @msykes)

    (@netweblogic)

    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

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to change event_list attributes with an anchor’ is closed to new replies.