Support

Home Forums Event Espresso Premium Virtual Location Information

Virtual Location Information

Posted: July 30, 2015 at 2:26 pm

Viewing 3 reply threads


Dallas REIG

July 30, 2015 at 2:26 pm

Hello, I am new to EE4 and have a venue setup that is virtual but I cannot find a way to show the virtual url or call-in number on my event view.

Is there a way to do this? I see in the template the event phone number is being outputted with espresso_event_phone( $post->ID, FALSE ); but I am looking for how to add venue virtual information for reusability.

Thanks in advance.


Lorenzo Orlando Caum

  • Support Staff

July 30, 2015 at 5:36 pm

Hi Maceo,

Is that information something that could be added to the venue excerpt or venue description?


Lorenzo


Dallas REIG

July 30, 2015 at 5:47 pm

Sure I could add it there or to a different location or even to the event text itself as free form text, 🙂

Are you saying that the virtual location information is there but not usable for anything?

Ultimately, I will be programming to hide this information based on if the user paid or not so was looking to use the dedicated field references.


Tony

  • Support Staff

July 31, 2015 at 8:40 am

Hi Maceo,

If you are familiar with PHP and OOP you can get to that field pretty easily using our models.

If you are within the loop and have the the EE_Event object already you can use:

//Pull an array of all venue objects assigned to the event
$venue = $event->venues();
						
//Check venues were actually returned. Shirt the first venue object from the array.
$venue = !empty( $venue ) ? array_shift( $venue ) : NULL;

//Use the venue objecy methods to out the virtual_url							
if ( $venue instanceof EE_Venue ) {
	echo $venue->virtual_url();
}

Or We also have helper functions available to do most of this, for example:

//You may need to call the helper, it depends where you are using this
EE_Registry::instance()->load_helper('Venue_View');

//Returns the first venue object it finds for the event.
$venue = EEH_Venue_View::get_venue();

//Use the venue object methods to output the virtual_url
if ( $venue instanceof EE_Venue ) {
	echo $venue->virtual_url();
}

Which you use and how you do it depends on where you are using this code and what you are using it for.

Does that help?

Viewing 3 reply threads

The support post ‘Virtual Location Information’ 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