Support

Home Forums Event Espresso Premium List Sub Events on EE4 Course Listing Page

List Sub Events on EE4 Course Listing Page

Posted: November 27, 2014 at 12:28 pm


Susan Perry

November 27, 2014 at 12:28 pm

Hello Support,

Is there a way to display the sub events and not just the first event on the E4 Custom Listing template add-on? The only way we see to do it currently is create only main events and not use the sub event capability.

Thanks


Lorenzo Orlando Caum

  • Support Staff

November 27, 2014 at 2:59 pm

Hi,

What is the difference between a regular event and a sub-event?

The templates will show a list of events based on parameters that are set (e.g. events for a specific event category).


Lorenzo


Susan Perry

November 30, 2014 at 1:30 pm

Hello Lorenzo,

We want all of the sub events for an event to also show the dates and times available on the course listings page, not just the first sub event under the main event.


Tony

  • Support Staff

December 1, 2014 at 3:37 am

Hi Susan,

How are you setting up Sub Events?

Is this is a single event with multiple Datetimes?


Susan Perry

December 2, 2014 at 12:28 pm

That is correct Tony. How can we get the other date times to display on the course listing table?


Lorenzo Orlando Caum

  • Support Staff

December 2, 2014 at 2:30 pm

Hi,

Please see this tutorial:

https://gist.github.com/lorenzocaum/ac217033f12232404cce

The first option will show the starting date times and the alternative options will show all date times along with an iCal button for each.


Lorenzo


Susan Perry

December 3, 2014 at 9:41 am

Hi Lorenzo,

This worked great, however the main events are not ordered in descending order. This is the shortcode I used:

Brampton

[ESPRESSO_EVENTS_TABLE_TEMPLATE template_file=”espresso-events-table-template.template.php” category_slug=”bt-brampton” order_by=”start_date” order=”DESC” category_filter=”false” table_search=”false”]

Oakville

[ESPRESSO_EVENTS_TABLE_TEMPLATE template_file=”espresso-events-table-template.template.php” category_slug=”bt-oakville” order_by=”start_date” order=”DESC” category_filter=”false” table_search=”false”]

Thanks for your assistance.


Lorenzo Orlando Caum

  • Support Staff

December 3, 2014 at 10:19 am

Hi,

Those tutorials don’t use the shortcode parameters. Try updating the datetimes on one of the events to sort the order.


Lorenzo


Susan Perry

December 3, 2014 at 11:18 am

Hi Lorenzo,

Unfortunately your suggestion did not work. Any other ideas? This is critical to us.


Lorenzo Orlando Caum

  • Support Staff

December 3, 2014 at 1:02 pm

Does it work when those changes are reversed or was that not working?

Also, could you let us know the version number for the add-on?


Lorenzo


Susan Perry

December 5, 2014 at 11:48 am

Hi Lorenzo, it does not work even after disabling the custom template… Any ideas?


Susan Perry

December 7, 2014 at 12:24 pm

Anyone?


Tony

  • Support Staff

December 8, 2014 at 5:12 am

Hi Susan,

Can you link me to the page you are using that template on please?

When I test this locally the events display correctly so I’d like to see if I can see a reason for this.


Susan Perry

December 8, 2014 at 8:20 am

http://safetycoursesforkids.com/children-safety-courses/red-cross-babysitting-course/


Tony

  • Support Staff

December 8, 2014 at 10:52 am

Hi Susan,

The reason the sorting isn’t working correctly is the attribute should be ‘sort’, so the shortcodes need to be:

[ESPRESSO_EVENTS_TABLE_TEMPLATE template_file=”espresso-events-table-template.template.php” category_slug=”bt-brampton” order_by=”start_date” sort=”DESC” category_filter=”false” table_search=”false”]

&

[ESPRESSO_EVENTS_TABLE_TEMPLATE template_file=”espresso-events-table-template.template.php” category_slug=”bt-oakville” order_by=”start_date” sort=”DESC” category_filter=”false” table_search=”false”]

That should then allow you to alter the order.


Susan Perry

December 8, 2014 at 5:54 pm

Tried the sort parameter even when switching back to the default event listing template and I am still having no luck. Could you please provide a solution?

Thanks


Susan Perry

December 8, 2014 at 6:17 pm

This did not work. Even when reverting back to the non modified custom listing template. Please provide a resolution ASAP.


Tony

  • Support Staff

December 10, 2014 at 4:19 am

Would it be possible for me to take a look at the events on your site and dig a little deeper into this?

If so please use this form to provide temporary login details:

https://eventespresso.com/send-login-details/

The shortcode is working as expected for me locally, I’ve modified the template in the same way @lorenzo mentioned and the events are correctly sorted by datetime.

Listing the events DESC shows highest (older) dates first. Fed 2015 then Dec 2014 etc

Listing in ASC shows the lowest (newer) date first. Dec 2014 then Fed 2015 etc.

Each event will show as a single event with all of that events datetimes listed and ‘first’ earliest datetime for that event will be used to sort.


Susan Perry

December 15, 2014 at 6:23 am

Hi Tony,

I just sent the login details.


Tony

  • Support Staff

December 15, 2014 at 9:41 am

Hi,

I did a little investigating into this and it turns out this is being caused by the previous [ESPRESSO_EVENTS_TABLE_TEMPLATE] shortcode that is being used for Brampton (which currently lists no events)

If you remove that shortcode from the page the events are listed correctly, however I have duplicated the event setup you have locally and used the shortcodes in the same way you have with no issues so I suspect this is due to the theme or plugin doing something strange with $wp_query.

If you install Theme Test Drive you can activate another theme without altered the site for non-admins. Can you try activating a default theme such as twentyfourteen and re-testing that page, do the events display in the correct order?


Susan Perry

December 26, 2014 at 10:23 am

Hi Tony,

Even with the default theme active the order issue still occurs. I realize this can be resolved by removing the shortcode for cities that do not have any events, however this is an unacceptable solution because it creates much more admin work for us because we then need to add the shortcode back when there are events for the city. Please help us with a resolution.

Thanks


Susan Perry

December 30, 2014 at 6:16 pm

Hi Tony,

Any ideas?


Tony

  • Support Staff

January 5, 2015 at 5:29 am

Hi Susan.

I’m sorry for my delay getting back to you.

We have managed to reproduce this issue locally and have created a ticket for our developers to investigate. When using multiple instances of the shortcode within a single page, the first instance will work as expected, but the order_by and sort values are being stripped from any subsequent instances of the shortcode.

So in order to display your events correctly ordered by start_date you’ll currently need to either use a single shortcode on the page, or swap them around so that the shortcode that currently returns events is before the shortcode returning no events.

So in the example in this thread it would be

[ESPRESSO_EVENTS_TABLE_TEMPLATE template_file=”espresso-events-table-template.template.php” category_slug=”bt-oakville” order_by=”start_date” sort=”DESC” category_filter=”false” table_search=”false”]

[ESPRESSO_EVENTS_TABLE_TEMPLATE template_file=”espresso-events-table-template.template.php” category_slug=”bt-brampton” order_by=”start_date” sort=”DESC” category_filter=”false” table_search=”false”]

So that the oakville shortcode (which returns events) runs first and the brampton shortcode (which does not return events) runs after that (the order_by and sort values are un-needed if there are no events).

However if brampton than does have events assigned to that category, those events will not be ordered correctly.

Once we have found a fix and updated the Event Tables Templates Add-on you should then be able include both instances of the shortcode on a single page without issue.


Susan Perry

January 5, 2015 at 7:29 am

Could you please give us a rough idea of how long you expect this fix will take to be implemented? 1 week, 1 month, etc? Could you also notify us once the fix has become available?


Tony

  • Support Staff

January 5, 2015 at 11:20 am

I added this thread to the ticket so we will post an update here once the update has been released.

Could you please give us a rough idea of how long you expect this fix will take to be implemented? 1 week, 1 month, etc?

Unfortunately I can not provide any timeline currently, our developers are investigating this so once the cause is found we will have more of an approximate timeline.


Susan Perry

January 6, 2015 at 8:43 pm

Thank you Tony.


Susan Perry

January 13, 2015 at 5:04 pm

Any update?


Dean

January 14, 2015 at 3:57 am

Hi,

The ticket has been assigned to a developer to look at but there is no update as yet.


Susan Perry

January 15, 2015 at 7:23 am

Thanks Dean.

The support post ‘List Sub Events on EE4 Course Listing Page’ 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