Essential Grid - Show Upcoming Events

Hi,
Is there a way to show only upcoming events in the essential grid?
The event date field meta is: wpcf-event-date
Is that can be done in the Additional Parameters field at the grid settings? something as event date greater or equal to today?
If not, is there any other ways of doing it?
Thanks!

Hi Amir,

Thanks for reaching out.

It’s not currently possible with the available options, the upcoming events are based on current date compared to future date of the event post. It could be done with custom development (custom query), but I’m not really sure exactly how. I recommend contacting a developer for this implementation.

Thanks!

Hi Rad,

Interesting, I thought that the “Additional Parameters” field at EG is made for that type of requirements. If its is not for that then what this field do?

Thanks!

Hi Amir,

The parameters is for WP_Query, please check this https://www.themepunch.com/faq/grid-custom-order/. The parameters that you could use is only limited to WP_Query standard.

Please check these https://codex.wordpress.org/Class_Reference/WP_Query#Order_.26_Orderby_Parameters. That reference is provided from that EG’s documentation.

While the event is a custom post type where post meta and additional data are implemented in a different way. Hence, not covered by simple parameters that Wordpress understands by default. I’m not saying it’s not completely possible, it’s just not possible with the current options so you’ll have to do custom development to achieve it. For that, I recommend contacting a developer.

This might help as well, not the same but similar customization may apply since Woocommerce uses custom post type as well and different data structures. https://www.themepunch.com/faq/only-include-in-stock-woocommerce-products-in-grid/

Thanks!

Thanks Rad! I eventually got to https://www.themepunch.com/faq/advanced-additional-parameters/ which described how to do it without custom development. I applied it, and it works.

I do have two questions and would be happy if you can assist:

  1. When no upcoming events exist, how can I show text describing that “no items were found” or something similar? Now the grid is just empty when there are no future events.

  2. The example at https://www.themepunch.com/faq/advanced-additional-parameters/ works for a single grid ID. How can I include multiple grid IDs in it?

Thanks Again! Appreciate your help!

  1. The grid does not really have a view if there is no item being displayed except if you’re using a filter or there’s no result using the filter.

    The sample code only alters what posts will show in the grid. To display another view other than the grid would require you to add your own conditions and maybe call your own function. That just theory though.
  2. You can try using the OR logical operator like ($grid_id == 36 || $grid_id == 37).

I’d recommend that you consult with a third party developer for this especially if what I said doesn’t work.

Thanks.

Hi Christian,

  1. So it seems that the query solution offered at https://www.themepunch.com/faq/advanced-additional-parameters/ has not been thought through by whoever published it. It is very likely that from time to time, the grid will return no results when it is filtered to return only future dates. And in that case, a message must be shown to the user for adequate UX. Exactly as the message displayed to users when filtering the grid returns no result.

  2. Thanks, I will try that.

P.S. I’m sure a developer would be able to work around this with customization. But since I followed the instructions at EG documentation, I feel it should be provided by support.
Thanks.

Hi Amir,

The grid wasn’t really made for events, I’m surprised it works with parameters option especially the blog only has one field for date. Perhaps, the one you’re using uses the same date field. And it was meant for standard media grid purposes.

I’m not sure if they will going to support it, but they may accept that as a feature request since it’s not a bug or issue.

Thanks!

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.