Support

Home Forums Event Espresso Premium Adding "Trainer" and "Event end date" columns to Table view template

Adding "Trainer" and "Event end date" columns to Table view template

Posted: November 5, 2018 at 8:20 am

Viewing 4 reply threads


Porter

November 5, 2018 at 8:20 am

Is it possible to add two columns to the Table view to show “Trainers” and “Event end time”?
Thanks


Tony

  • Support Staff

November 6, 2018 at 7:43 am

Hi there,

Yes, it is possible to create your own custom version of the template, place it in your themes root directory (preferably a child theme unless your using your own custom theme) and load additional details.

Inisde the addon look in: \eea-events-table-template\templates\

The default template is espresso-events-table-template.template.php

You’ll need to comfortable with PHP to add the additional columns, I’m assuming ‘Trainers’ were added to the event using the People Add-on?

Event end date could be multiple different things depending on your setup, is it a single event with a single datetime?


Porter

November 6, 2018 at 8:45 am

Thanks. Yes trainers were adding using the People Add-on. It was the “Event End” time that we wanted included in the table.


Tony

  • Support Staff

November 6, 2018 at 10:07 am

Yes trainers were adding using the People Add-on.

Ok, so you can use something like:

$people = EEM_Person::instance()->get_people_for_event_and_type($event_id = $post->ID, $people_type_id = 111);

You’ll need to change the 111 to your ‘Trainers’ people type ID which you can get from Event Espresso -> People Admin -> Types.

The table there will show you your people types and their ID’s.

$people will than be an array of EE_Person objects, or an empty array (if no people are assigned to the event), you can then loop over the array and output the people in the table.

It was the “Event End” time that we wanted included in the table.

‘Event End’ is set on a datetime within an event, but you can have multiple datetimes, for example here is an event with 3 datetimes – http://take.ms/S6onR

Do you only have one datetime in the event/always want to show the ‘last’ datetime?

Currently the table show the start date and time, do you want to include the start and end in the same column, or separate it out into start and end?


Porter

November 7, 2018 at 4:05 am

This reply has been marked as private.
Viewing 4 reply threads

The support post ‘Adding "Trainer" and "Event end date" columns to Table view 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