Posted: October 17, 2014 at 9:26 am
|
Do you have a suggested work-around for correctly displaying events that are in a series where the original start has past but there are still upcoming dates in the series? ie. Event dates are oct 1, 12, 20, 27. At the moment, order_by=start_date pulls the first event date in the series even if expired. I tried order_by=event_date just for fun but that didn’t work. Over half of our events are series events. This makes a grid view of the events un-workable. We already scrapped the calendar plug-in because it wasn’t showing properly on mobile. Suggestions appreciated. TY. We are using EE4=Version 4.4.3.p |
|
Anyone out there? |
Hi Laura, I’ve been looking into this. By “correctly” do you mean something along the lines of “the next upcoming date for this event”, or something else? |
|
|
Hi Josh, TY for your reply. |
Hi Kristen, This is possible with a few edits and a new template tag function. First, here’s the function: function espresso_next_upcoming_event_date( $EVT_ID = 0, $date_format = '', $time_format = '', $show_expired = NULL ) { $date_format = ! empty( $date_format ) ? $date_format : get_option( 'date_format' ); $time_format = ! empty( $time_format ) ? $time_format : get_option( 'time_format' ); EE_Registry::instance()->load_helper( 'Event_View' ); $datetimes = EEH_Event_View::get_all_date_obj( $EVT_ID, $show_expired ); if ( is_array( $datetimes ) && ! empty( $datetimes )) { global $post; foreach ( $datetimes as $datetime ) { if ( $datetime instanceof EE_Datetime ) { $the_dates[] = $datetime->date_range( $date_format ); } } } $html = array_shift( $the_dates ); return $html; } You can add the function to the table template file, your theme’s functions.php file, or (recommended) into a custom snippets plugin. Basically what this function does is return the next upcoming date for the event. Then you open up the espresso-events-table-template.template.php file and look for this line of code around line 98 or so:
You’ll replace it with this:
|
|
The support post ‘ee4 events table view template – event start date’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.