Modern Event Calendars Single and Archive layouts support

Hi,

I’ve been looking forward to support for custom MEC layouts for literally years… I’m excited to see this moving forward.

Today I tried to get an archive page working — I’d previously gotten a looper to work with this solution (making sure to return results for all the upcoming+recurring events):

… but now it seems that it severely bogs down the server. And none of the other query-string based answers I found in the Forum provide complete results.

I did find something promising in the Webnus documentation:

…thinking that I might be able to use one of these to generate a custom query function…

$upcoming_events = MEC_main::get_upcoming_events(20); // 20 is number of events
$events = MEC_main::get_shortcode_events(6380); // 6380 is the shortcode ID

…like this?

add_filter(‘cs_looper_custom_mymecevents’, function ($upcoming_events) {
$upcoming_events = MEC_main::get_upcoming_events(20);
return $upcoming_events;
});

…but so far, no luck. Any thoughts?

1 Like

I’d very very curious for more info on this? Maybe a tutorial for Josh on what is possible with the new layouts integration with MEC?

For that custom looper you sent me. Since the keys of that output are the “date”. I would use “Loop Keys”. That way when you use {{dc:looper:index}}, it will give you the date like “2025-01-23”.

image

Since the data is an array of events you need to double loop after your custom looper.

image

Then with the beautiful Looper field UI you’ll see all the MEC fields. There is a bug here where it can’t grab keys of an object that I need to fix here though in Beta2

image

Appreciate the thoughts and thanks for testing. If there is enough support we can add even more features to our MEC integration in a future release.

1 Like