Posted: June 9, 2014 at 5:01 am
|
Hi Guys, Can someone point me in the right direction please as to how I go about adding additional category filters to the custom ‘Events Table’ – https://eventespresso.com/wiki/custom-template-add-on/ http://screencast.com/t/wIQDhp7tIvMG Is it by using the meta boxes? – http://screencast.com/t/s1MTHPG8CtaO Thanks. |
|
I’m guessing that you are going to use it for multiple categories per event. So that to show the event, it has to match all the categories selected? The first step would be to fix the table so that it correctly adds a class to the row for each category the event has. You’ll want to edit plugins/espresso-custom-templates/templates/events-table/index.php to replace lines 87-93 with the following: |
|
Thanks Sidney, I’ve been working on just having the 3 different category filters to test it out, as seen here – http://screencast.com/t/npUYgypun Here is the code – http://screencast.com/t/WpIoQzKmHsTz Thanks |
|
Something like this? <p class="category-filter"><label><?php echo __('Filter by category ', 'event_espresso'); ?></label> <select class="" id="ee_filter_cat"> <option class="ee_filter_show_all"><?php echo __('Show All', 'event_espresso'); ?></option> <?php foreach($events as $event_date) { echo '<option value="' . $event_date->start_date . '" class="date_' . $event_date->start_date . '">'. date('m/d/Y', strtotime($event_date->start_date) ) . '</option>'; } ?> </select></p> <p class="category-filter"><label><?php echo __('Filter by category ', 'event_espresso'); ?></label> <select class="" id="ee_filter_cat"> <option class="ee_filter_show_all"><?php echo __('Show All', 'event_espresso'); ?></option> <?php foreach($events as $venue_id) { echo '<option value="' . $venue_id->venue_id . '" class="date_' . $venue_id->venue_id . '">'. $venue_id->venue_name . '</option>'; } ?> </select></p> You will need to modify the jQuery to make it so that it filters correctly. That will be the hardest part I think. |
|
Thanks Dean, Do you think a class and category also has to be added here too? – Then replicate those differences in the jQuery also? Thanks. |
|
Row 2 in your code. |
|
Yeah, Just add something like class="cat_<?php echo $cat_class; ?>" |
|
Thanks Dean. |
|
No problem! |
The support post ‘Adding category filters to custom table’ 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.