Support

Home Forums Event Espresso Premium Venue Category and Image in Table Template

Venue Category and Image in Table Template

Posted: August 27, 2015 at 9:42 am

Viewing 8 reply threads


Faique Fakier

August 27, 2015 at 9:42 am

Hi

I please need the venue Category and venue image to display in the table template, how can I go about doing this?

please advise


Tony

  • Support Staff

August 28, 2015 at 3:45 am

Hi there,

The venue details are not included within the template, so you would need to create a custom template which included the details you wanted, this is not something we can provide support for on the forums.

If you are comfortable using PHP we can point you in the direction?

If not I would recommend contacting a developer to include this, we have a list of developers familiar with EE here:

https://eventespresso.com/developers/event-espresso-pros/


Faique Fakier

August 28, 2015 at 8:45 am

Hi Tony.

I am fairly comfortable with PHP, please do advise.

Thanx


Tony

  • Support Staff

August 28, 2015 at 9:16 am

Well within the template you have the EE_Event object within $event.

You can then use our models to pull in all of the information required.

So for example to pull in the venues with the event models you van doe something like this:

//Pull an array of venue objects for all venues assigned to the event
$venues = $event->venues();

//Shift the first element from the array and use as the venue object.
$venue = !empty( $venues ) ? array_shift( $venues ) : NULL;

//Echo venue name
if( $venue instanceof EE_Venue ) {
echo $venue->name();
}

If you var_dump() the venue object it will show you a list of available methods within that object, (such as name() ) that you can run for various values.

You should be able to pull in the custom taxonomy for the EE_Venues using $venue->term_taxonomies()

Venue image is the feature image for the venue CPT so something like $venue->feature_image() should output that too.

You can copy the current template espresso-events-table-template.template.php from within the add-on to /wp-content/uploads/espresso/templates/

Make modifications there and it will load that in its place.

Does that help?


Faique Fakier

August 28, 2015 at 4:27 pm

great thank you. I managed to get this right.

Could you advise similarly how I could add ‘people’ to the table, i.e Role, Name, Image


Josh

  • Support Staff

August 31, 2015 at 4:59 pm

Hi Faique,

You basically copy the php code from the People add-on’s content-espresso_events-people.php file and then print the values extracted from the loop to the table cells for those columns.


Faique Fakier

September 1, 2015 at 11:14 am

Great, Thanx Josh, all sorted


Lorenzo Orlando Caum

  • Support Staff

September 1, 2015 at 1:57 pm

Hi, do you have an example of your updated events table template on a page?

We have seen venue information added but not information from the people records so this would be interesting to see.

Thanks!


Lorenzo


Faique Fakier

September 1, 2015 at 4:59 pm

Hi Lorenzo

Sure, you can check it out here:

http://careandgrowth.com/events-list/

Viewing 8 reply threads

The support post ‘Venue Category and Image in Table 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