Support

Home Forums Event Espresso Premium Conditional Statement for Event Venue

Conditional Statement for Event Venue

Posted: December 30, 2013 at 2:51 pm

Viewing 4 reply threads


Angela Haddon

December 30, 2013 at 2:51 pm

Hi, I’d like to add a simple conditional statement that will display a Google map ONLY when the event venue Address holds information (otherwise a blank map is displayed). I’m just not sure what variable I should be targeting, and would appreciate any help in setting this up.
Thanks for your help!


Sidney Harrell

December 30, 2013 at 11:47 pm

Hey Angela,
Sorry for that. Where exactly are you seeing the blank map? On the event list, an event post, or the registration page?


Angela Haddon

December 31, 2013 at 3:09 pm

Hi Sidney, it’s actually within the ticket template; I currently have a section at the bottom of the ticket which displays the location (and google map) for the attendee’s convenience. It works fine, but in those cases where a venue is yet to be determined, obviously there’s no data to plug in, resulting in a blank google map. In those cases, I’d like the bottom section not to display at all (hence a conditional statement); is this possible?
Thanks so much for your help!


Sidney Harrell

December 31, 2013 at 4:35 pm

The function generating the map and link is espresso_google_map_link in includes/functions/main.php starting on line 949. It is an overrideable function, so you can copy the function to one of the following:
1 – Your theme’s functions.php file. It may get overwritten the next time you update your theme.
2 – The EE custom files add-on in the custom_functions.php file.
3 – Use this blank plugin to hold the custom function.
After the address assignment line, you can put in something like:

if (empty($address)) return '';


Angela Haddon

January 1, 2014 at 1:46 pm

Thanks Sidney! Much appreciated 🙂

Viewing 4 reply threads

The support post ‘Conditional Statement for Event Venue’ 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.

Event Espresso