Support

Home Forums Event Espresso Premium Changing the default 'no events' message

Changing the default 'no events' message

Posted: September 19, 2016 at 7:21 am


Gaviny

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:
“It seems we can’t find what you’re looking for. Perhaps searching can help.”

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


else :
	// If no content, include the "No posts found" template.
	espresso_get_template_part( 'content', 'none' );

endif;

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


Gaviny

September 19, 2016 at 7:28 am

Sorry, i forgot to reference the topic i had found.

previous topic i was referring too


Tony

  • Support Staff

September 19, 2016 at 2:37 pm

Hi PhilB,

So this code:

espresso_get_template_part( 'content', 'none' );

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 espresso-events-table-template.template.php, are you loading that template within your themes root directory or are you looking within the table plugin?

Also does your theme currently have a ‘content-none.php’ template file?


Gaviny

September 20, 2016 at 3:41 am

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
espresso_get_template_part( 'content', 'none' );
(‘content’ , ‘none’ ) to ( ‘content’ , ‘noevent’) ?

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.


Tony

  • Support Staff

September 20, 2016 at 5:47 am

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
espresso_get_template_part( ‘content’, ‘none’ );
(‘content’ , ‘none’ ) to ( ‘content’ , ‘noevent’) ?

Yes that’s correct.

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?

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.


Gaviny

September 21, 2016 at 6:50 am

Hi,

Thanks Tony, Good stuff. I will give it a try this afternoon and see how i get on.

PhilB


Tony

  • Support Staff

September 21, 2016 at 7:34 am

Let me know if you run into any problems 🙂


Gaviny

September 21, 2016 at 7:39 am

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


Tony

  • Support Staff

September 21, 2016 at 8:41 am

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?


Gaviny

September 21, 2016 at 9:20 am

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


Tony

  • Support Staff

September 22, 2016 at 4:05 am

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.

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.

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.

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.


Gaviny

September 23, 2016 at 2:11 am

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


Josh

  • Support Staff

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.


Gaviny

September 26, 2016 at 2:02 am

Thanks Josh, il take a look this afternoon and see if i can figure it out.

Many thanks guys,

PhilB


Tony

  • Support Staff

September 26, 2016 at 6:23 am

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:

function tw_ee_show_custom_venue_info ( $post ) {

	$email = get_post_meta($post->ID, 'venue_organizer_email', true);

	if( ! empty( $email ) ) {
		echo $email;
	}

}
add_action( 'AHEE__content_espresso_venues_details_template__after_the_content', 'tw_ee_show_custom_venue_info' );

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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 2 years, 11 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!