Support

Home Forums Custom Files Add-on (EE3) How To Display Venue Title on Custom Template

How To Display Venue Title on Custom Template

Posted: June 25, 2013 at 11:06 am


Dan Stover

June 25, 2013 at 11:06 am

Hello EE crew,
I am working on modifying the espresso_table.php custom template to display my items in a nice list (I am already using the event list template on a custom widget). I need to figure out how to get the venue title to display within the espresso_table file. I have tried several different options so far including code copied from the event list template(which displays the venue title properly). These options include but are not limited to:

<?php echo $venue_title; ?>

<?php echo $event->venue_title; ?>

<?php $event_venue = do_shortcode(‘[ESPRESSO_VENUE event_id=”‘.$event_id.'”]’) ?>

<?php echo $event_venue; ?>

<?php echo do_shortcode(‘[ESPRESSO_VENUE event_id=”‘.$event_id.'”]’);?>

<?php echo $venue_title != ”?'<p id=”event_venue_name-‘.$event_id.'” class=”event_venue_name”>’.stripslashes_deep($venue_title).'</p>’:” ?>

<?php echo stripslashes_deep($venue_title); ?>

 

The <?php echo $event_venue; ?> and <?php echo do_shortcode(‘[ESPRESSO_VENUE event_id=”‘.$event_id.'”]’);?> have successfully displayed all venue info including maps for all venues, but that is not even close to what I am trying to show.

How can I get the venue name to display on the espresso_table.php template or any custom files template for that matter. Perhaps it is missing a variable toward the top of the template? Any and all help is greatly appreciated.

-Dan


Josh

  • Support Staff

June 25, 2013 at 12:27 pm

Hi Dan,

The espresso_table.php template makes use of the old venue manager, which is different than the new venue manager that stores venue info in their own database table. The old venue manager stores venue info inside the events_detail table.

So if you use the old venue manager, the espresso_table template wouldn’t need much in the way of modifications to display venue info. You can display the venue title with:

<?php echo $event->venue_title; ?>

If you’re using the new venue manager, you could add a custom query in the template to grab the venue details (which is what event_list.php does, you can see how in lines 120 and 130 in event_list.php) or use the ESPRESSO_VENUE shortcode like this:

<?php echo do_shortcode('
      [ESPRESSO_VENUE event_id="'.$event->id.'"
      show_image=false
      show_description=false
      show_address=false
      show_additional_details=false
      show_google_map_link=false
      show_map_image=false]
');?> 


Dan Stover

June 25, 2013 at 12:34 pm

Josh,

The code you posted worked perfectly. Thank you so much!

-Dan

The support post ‘How To Display Venue Title on Custom Template’ 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