Pods with Modern Tribe Event Calendar: How display only events from current day
-
Hey there fine PODs enthusiasts!
Doing some digging around, it looks like you all have a lot of experience with The Event Calendar by Modern Tribe.
I love both plugins. However, I have no idea how to tackle this issue…
I created a POD template for tribe_events so I can display the information just how I want it along with some new taxonomies, easy-peezy.
However, I ran into one issue… I want this template to display events just from the CURRENT date.
I figured this can be done using the “where=” somehow… but I am just lost on how to do it.
Any suggestions?
-
It should be noted that the official meta key that The Events Calendar uses for start date is actually
_EventStartDate
.[pods name="tribe_events" where="CAST( _EventStartDate.meta_value AS DATE ) = CAST( CURDATE() AS DATE )" template="program screen"]
-
This reply was modified 5 years, 9 months ago by
Scott Kingsley Clark.
You may also try this one:
[pods name="tribe_events" where="CAST( _EventStartDate.meta_value AS DATE ) = DATE( NOW() )" template="program screen"]
HALLELUJAH!
It works!!!
Thank you guys so much for your help!
This is the one I used:
[pods name=”tribe_events” where=”CAST( _EventStartDate.meta_value AS DATE ) = CAST( CURDATE() AS DATE )” template=”program screen”]Now, I need to finish the template and such, that will be easy. The only other question I have (and I may end up testing it out and figuring it myself, but thought I would ask while I have you here), is, how easy is it to order the events by the event start time?
Okay, I have two more problems. I appreciate the help you’ve given me and I am sorry if it seems I need to be handheld for this… but even if you point me in the right direction, I’d be happy.
When editing my template, I can’t figure out how to display the venue associated with the event as it isn’t listed under “Pod Reference” when creating the template… I am not sure if that is because venues are technically a CPT or not. I don’t need the address to show, just the name of the venue.
I also am not sure how to organize the events by start time when inputting the shortcode.
Any ideas?
You can sort by using the
orderby="..."
parameter in the shortcode (see https://pods.io/docs/learn/shortcodes/pods/ for docs on that).[pods name="tribe_events" where="CAST( _EventStartDate.meta_value AS DATE ) = DATE( NOW() )" orderby="_EventStartDate.meta_value ASC" template="program screen"]
You can try
{@_EventVenueID,get_the_title}
for getting the venue title.@michaelrayburke Our plugin is not designed to manage The Event Calendar events. You’re backing yourself into a corner by not making use of the functionality that The Event Calendar natively provides (ie upcoming/past events, sorting, etc., basically everything that is built into their API).
When you extend something with Pods, you’re adding functionality, not replacing it. You can do some amazing things with Pods, but when it comes down to trying to reproduce the entire functionality in display of The Event Calendar with Pods, we’re just not able to help you do that, because that’s out of scope for our plugin, especially if that functionality is built-into The Event Calendar.
Please see our Scope FAQ: https://docs.pods.io/faqs/what-can-you-build-with-pods/
Thanks!
-
This reply was modified 5 years, 9 months ago by
Jim True.
If you’re uncomfortable with PHP, there are two very powerful plugins that provide display functionality for The Event Calendar that are specifically designed to output archives and detail pages:
https://wordpress.org/plugins/template-events-calendar/
https://wordpress.org/plugins/event-page-templates-addon-for-the-events-calendar/They both do an excellent job and you can easily ‘incorporate’ your Pods additions with Auto Templates in the Detail page. You also might be able to pull in Pods Custom Fields into that shortcode.
@jimtrue you know, I am paying for the Tribe Event Calendar Pro plugin, and it turns out it doesn’t do exactly what I want it to do. I need the content to not only display customized for a certain page, I need the extended fields as well. I appreciate your help, so thank you for that, and if you can’t help any further or feel like what I am working on is unnecessary, that’s totally okay, cool? π
I am fairly comfortable with PHP, but this solution is the easiest to continue the method I already have started to accomplish my goal.
-
This reply was modified 5 years, 9 months ago by
michaelrayburke.
@sc0ttkclark
Thanks so much for your help!The orderby worked. But the venue code for the template just gives the title of the page I have the shortcode embedded on for some reason.
I am working on this, but if you have another idea, that would be great too. π I just want to display the venue name with each event… after that, I have everything I need.
If there’s a reference sheet somewhere, that would be cool too.
@michaelrayburke if you pay for Pro with The Event Calendar, that means you’re eligible for support directly from them. The reason we suggest not trying to recreate the Event Archive or Event Detail page is because, when you do that, you’re stepping outside of the natural functionality of the plugin. If the plugin changes their API and you’re not using the API to generate that output, you’re going to break and come running at Pods for that breakage.
That’s why we suggest not going ‘off the rails’ when it comes to working with other plugins and extending them with Pods. Use their Methods, use their templates, but ‘enhance’ them with Pods information. Extended fields are very easy to display on a Single Detail Event Template with the Auto Templates functionality we discuss in the Grow video.
It’s a lot harder in the Calendar templates provided by TEC Pro, but not as hard with those shortcode plugins I recommended. All of those are shortcodes using the The Event Calendar API for their output, so if TEC changes their API, those plugins will also update and you won’t break. Basically, if you end up creating a display that just uses the fields and Pods to create it, you run the risk of TEC changing their field names or something else and since you’re bypassing their API, you will break if they do that.
We don’t provide reference sheets for other plugins; we can only provide reference sheets for fields that we support, that’s why we can’t really output them in the ‘Reference’ inside Pods Templates. All of the relationships between Events and Organizer and Venues is managed by The Event Calendar, not Pods. Even if you extend those other post types (Organizers and Venues), you still aren’t going to be able to traverse into them like you would with a Pods Relationship field.
I’m basically trying to suggest ‘don’t go too far off the reservation, because if you do, you’re completely on your own’. And while I appreciate that you’ve already starting doing it this way, you need to weigh that energy you’ve taken against supporting this 3 years from now, especially if TEC goes another direction in their field storage (ie they decide to jump into using separate tables as opposed to Post Meta, which WooCommerce also did and many other large plugins are doing).
Can confirm, we are looking at the viability of table storage in the future for The Events Calendar. Not sure on final decision / timeline for TEC itself, but we’re already developing a custom table for recurring events in Events Calendar PRO.
-
This reply was modified 5 years, 9 months ago by
- The topic ‘Pods with Modern Tribe Event Calendar: How display only events from current day’ is closed to new replies.