Support

Home Forums Event Espresso Premium Add Category Column to Events Table Add-on

Add Category Column to Events Table Add-on

Posted: December 16, 2016 at 3:32 pm


jeffw@sky-line.com

December 16, 2016 at 3:32 pm

Is there a way to add a new column to the Events Table layout that will display event categories right in the table (as opposed to showing categories in the drop down list above)?


Tony

  • Support Staff

December 19, 2016 at 3:09 am

Hi there,

Yes however you will need a custom version of the template.

The event table add-on will load a custom version of the template if you place it within your themes root directory (preferably using a child theme).

If you take a look within /eea-events-table-view-template/templates/espresso-events-table-template.template.php around line 74 you’ll find the loop that builds out an array of category slugs, you can use that same loop to build out category names and then output those within the table.


jeffw@sky-line.com

December 20, 2016 at 3:41 pm

Thank you. Do you happen to know the line of code we need to add in order to pull that category column into the table?


Tony

  • Support Staff

December 20, 2016 at 6:29 pm

Seeing how its that time of year, how about a full example 🙂

Take a look here: https://gist.github.com/Pebblo/94a60e952f79a0d4e5a370a988a34543

The code that adds the Categories column to the headers is:

https://gist.github.com/Pebblo/94a60e952f79a0d4e5a370a988a34543#file-espresso-events-table-template-categories-template-php-L46

The code that outputs the categories in the table itself is:

https://gist.github.com/Pebblo/94a60e952f79a0d4e5a370a988a34543#file-espresso-events-table-template-categories-template-php-L113-L123

You can place that whole template file in the root directory of your theme (preferably using a child theme) and use the shortcode:

[ESPRESSO_EVENTS_TABLE_TEMPLATE template_file=espresso-events-table-template-categories.template.php]

To pull that custom template.

Does that help?

The support post ‘Add Category Column to Events Table Add-on’ 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