Posted: September 19, 2016 at 7:21 am
|
Hi, I know there are a couple of topics relating to this, but they are a couple of years old now and would like to know if the methods described still stand or if there was a newer way to do this. What i would like to do is change the default message on the events table from: I would like to change it to something like “we’re adding new events daily, please check back” or words to that effect. I have made changes like this before, editing the template file for the table, but after looking through the template file the the only part i can find relating to ‘no events’ is as follows
Taken from the end of espresso-events-table-template.template.php Could some clarify please? am i looking in the right place? or am i missing it completely? Any advice is greatly appreciated. Thanks PhilB |
|
Sorry, i forgot to reference the topic i had found. |
Hi PhilB, So this code:
Tells Event Espresso to look for a template file called ‘content-none.php’ within various locations through your site. Most themes usually have a ‘content-none.php’ template file and its output when nothing can be found regardless of what post type is used (in this case its our events). So, yes you can use the method in the above post to translate the text, however that will only work if your theme is translation ready and it will translate that text for all ‘no posts found’ output. You could create your own and load that within Also does your theme currently have a ‘content-none.php’ template file? |
|
|
HI Tony, Let see if i get this right. My theme has the content-none.php file (im using the Kleo theme from Seventh Queen) I’ve just looked in there after reading your reply and i can see the line of text in question. So i could make my own content-none.php with a different message, call it content-noevent.php and add the text i want into that file and then in the line I have a directory in my uploads/espresso/templates where i have the espresso events table template, so i would use that one to call my own template part? I made a change to that file before, changing the wording on the event dates column in the table. |
Yes that’s correct.
Yes, use your edited table view template to call the custom template for no events. That custom template will only be called for that specific event list (the table view) but it should work fine. |
|
|
Hi, Thanks Tony, Good stuff. I will give it a try this afternoon and see how i get on. PhilB |
Let me know if you run into any problems 🙂 |
|
|
Thanks Tony, that seems to have worked great. I have one other question though! Because the message is only displayed when there are no events, i would like to include the email address of the event organiser in the message. The problem is that i have 15+ organisers each with their own venue page. How possible is it to do this? i imagine it would involve some kind of conditional code, but i dont know where to begin trying to add this in. I’ve seen a few snippets of code for some other issues i’ve had that work, i was hoping one may exist to do this. Thanks! Phil |
So in order to display the event organizer you need the event, because the event organizer is assigned to the event right? The problem with what your trying to do is you want to display event specific data on a template you display when you cant find any events. That means you don’t have an event to pull the data you need from, make sense? How are you creating these event lists? |
|
|
You make an extremely good point Tony. I never thought about it like that. When i create them, i assign a venue and organiser from the ‘add event’ screen. I was thinking for some reason that because i had the venue page that i could match that up but you are right. if there is no event organiser then it wont work. Would i be correct in thinking there is no actual direct link between an organiser and a venue, so i wouldn’t be able to work on the venues ID/Slug to get the email address, and then when there are no events display it. I had another idea, thinking i could add an email address to the venue’s information page. I’ve just checked though and there is no email field on there. I could always just put the email address on the page statically in the meantime. Thanks PhilB |
Yes that’s correct, the relationship is between the event. The venue relates to the event and the organizer relates to the event, so you need the event object to pull it all together.
So each venue has a unique organizer for that venue? If so you could add the email address as a custom field within the venue, however you’ll need some custom coding to pull that into the venue output. Or you could include the email of the organizer within the Venue description to display it that way. |
|
|
Hi, The last option seems the easiest/quickest for now. I never even thought about that. The venues either have 1 or 2 organisers. Some organisers have 2 venues. I think il give the adding it to the venue description a go that might work. Is there any documentation available as guidance on how to go about the coding option? Thanks PhilB |
September 23, 2016 at 12:35 pm There’s some general information about how to use the recommended Advanced Custom Fields plugin with Event Espresso here: https://eventespresso.com/2014/08/developers-corner-using-advanced-custom-fields-extend-ee4/ Along with that, the action hooks that are available to use for adding extra content to a venue post can be found in the venue templates found in Event Espresso’s public/Espresso_Arabica_2014 folder. The venue templates have “espresso_venues” and “venues” in their name. |
|
|
Thanks Josh, il take a look this afternoon and see if i can figure it out. Many thanks guys, PhilB |
Just to note, the coding option still requires you edit each venue and add the email address to a custom field each time which means you could just add it to the description at the same time… However that won’t work if you want to add other conditions into the mix and will also depend on where exactly you want to display the email. Here is a quick example that will pull the custom field ‘venue_organizer_email’ from the venue post and echo it out to the page after the content:
|
|
The support post ‘Changing the default 'no events' message’ 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.