Posted: 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 |
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: |
|
|
Hi Tony. I am fairly comfortable with PHP, please do advise. Thanx |
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? |
|
|
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 |
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. |
|
|
Great, Thanx Josh, all sorted |
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! — |
|
|
Hi Lorenzo Sure, you can check it out here: |
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.