Posted: May 6, 2020 at 4:02 pm
I’m trying to do two things with the shortcode [ESPRESSO_MY_EVENTS template=simple_list_table]) #1: Is it possible to display the event date/time on this simple table? (Previously we had just [ESPRESSO_MY_EVENTS] that showed the date and time, but there was just too much – the simple table works better for our needs) #2: Is it possible to show under the ticket whether the registration is complete or waitlisted? We’d like that column to show “confirmed”, “canceled”, or “waitlisted” if possible. |
|
Hi there,
Yes, it is possible. You can override many of the templates used within EE by copying them to your themes root directory (preferably using a child theme) and EE will use those in place of the defaults. In the WP user Integration add-on you can see the templates in:
For the simple list template, the first template loaded is
Is loading the content template into the above. So depends on where you want to add the additional details you copy the template you need and modify it there. The simple list table works with EE_Registration objects and you can use our model system to pull pretty much any details you need from that object: https://github.com/eventespresso/event-espresso-core/tree/master/docs/G–Model-System You’ll see an example of how the event is pulled from the EE_Registration object in the content template I mentioned above.
Sure, again you’ll use the model system to do this, with an EE_Registration object in $registration you can do something like:
or
|
|
Amazing. This all worked beautifully. Thank you SO much. One more question… On the basic template of My Events, I found a snippet to sort based on date/time (https://github.com/eventespresso/ee-code-snippet-library/blob/master/addons/eea-wp-user/tw_ee_filter_getTemplateObjects__query_args.php) Is there a way to apply this same sort to the simple table? |
|
That snippet isn’t for sorting, it’s excluding expired events from the queries and should work on both templates. If you are looking to change the The simple_list template use the EEM_Registration model, the default template uses the EEM_Event model so you’ll want to check the object type in the same way the above snippet does before applying any additional code as each model will take slightly different parameters. Here are some details on passing order_by within the query params: |
|
I seem to be missing something. This is what I’ve got:
But I keep getting errors. Can you help me figure out where I’ve gone wrong? Thank you! |
|
Why are you targeting Event objects? Are you no longer using simple_list_table?
So your object_type will be ‘Registration’, you’re using the wrong example conditional from that snippet :), it should be:
This code:
I’m not really sure why you are doing this, why a new Just this:
I’m not really sure why you are doing this:
Why are you pulling the registrations in here? The add-on pulls the object for you, this filter is just filtering the query_params passed to whichever models it needs to use, so you don’t pull any objects in here. Using my snippet as an example, you could have just done something like this:
That would do both, sort by DTT_EVT_End DESC and remove expired events. If you don’t want to filter expired events then just remove the first line in that conditional. (Note, I’m writing the above in the forum to reply and have not tested this) |
|
Honestly, I’m not sure what I’m doing at this point. I might be past my brain limits here. I can’t seem to get it to sort by date. Even with the code you shared. I really appreciate your response, but I’m still struggling with this one! I don’t need to filter the expired events, I just want the events to be sorted by datetime. So the oldest events would be on the bottom, and the newest events on the top. I’m still using the simple_list_table, but I modified it to show the ticket type, and event date instead of location. (See here:https://share.getcloudapp.com/8LujgQzg) I’m probably making this harder than it needs to be… |
|
All you need is this:
|
|
Thank you SO MUCH. You are wonderful. If I wanted to leave the expired events, which part of this code would I remove? |
|
?? My code above does not remove expired events. If you do not want to exclude expired events, do not add this snippet to your site: |
|
Thanks so much. |
|
Hi there, Just checking in to see if you got this working how you wanted? If you don’t want to exclude expired events then the only code you need is the what I posted here: https://eventespresso.com/topic/modify-espresso_my_events-templatesimple_list_table/#post-311526 The other snippet specifically removes expired events, so you don’t need that if displaying them. |
|
The support post ‘Modify [ESPRESSO_MY_EVENTS template=simple_list_table])’ 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.