Support

Home Forums Event Espresso Premium Venue-link to website

Venue-link to website

Posted: October 20, 2014 at 1:14 pm


Michael

October 20, 2014 at 1:14 pm

Hi. I’m trying to use the info in template_tags.php to change the link for Event Venue from the EE Venue Page to the Venue website.
I’m doing this in the content-espresso_events-venues template
<h4><?php _e( ‘Venue:’, ‘event_espresso’ ); ?>   <?php espresso_venue_name ( $VNU_ID = 0, $link_to = ‘website’); ?></h4>

The puts appends the venue website to the post url, but I just want the venue website.

I am using template_tags.php as a reference, here:
if ( ! function_exists( ‘espresso_venue_name’ )) {
/**
* espresso_venue_name
*
* @access public
* @param int $VNU_ID
* @param string $link_to – options( details, website, none ) whether to turn Venue name into a clickable link to the Venue’s details page or website
* @return string
*/
function espresso_venue_name( $VNU_ID = 0, $link_to = ‘details’ ) {
EE_Registry::instance()->load_helper( ‘Venue_View’ );
echo EEH_Venue_View::venue_name( $link_to, $VNU_ID );
}
}

thanks


Lorenzo Orlando Caum

  • Support Staff

October 20, 2014 at 1:51 pm

Hi,

Try the theme template for venue website:

https://eventespresso.com/wiki/ee4-themes-templates/#venue-view

espresso_venue_website()


Lorenzo


Michael

October 20, 2014 at 2:03 pm

Thanks, that would work but I’m trying to display the Venue Name (default), but have it link to the Venue Website (option) instead of the EE Venue Page (default) for that Venue.

The code I included above has an option to do just this, but I’m not able to set the parameters correctly.


Lorenzo Orlando Caum

  • Support Staff

October 20, 2014 at 3:52 pm

Hi, that works in the current software at 4.4.3.

See the coding and the result here:

http://cl.ly/image/2h0j3g1c023G

This is the code adjusted from a default content-espresso_events-venues.php file:

  

There is no extra space on the php opening tags. See this:

http://cl.ly/image/440M2v2i0O3h


Lorenzo


Michael

October 21, 2014 at 7:57 am

sorry, you’re right. It works if the url is formatted with http://, not otherwise. That was my problem. Thank you

The support post ‘Venue-link to website’ 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