Support

Home Forums Event Espresso Premium Table View Not Displaying All Dates

Table View Not Displaying All Dates

Posted: April 12, 2016 at 10:03 am


Robert Zak

April 12, 2016 at 10:03 am

We have recently started putting up events that have multiple dates (for one course). I tried following this tutorial, but it is still only showing the first date in the table.

Here is my current code. I changed line 140 from:

<td class="start_date event-<?php echo $post->ID; ?>" data-value="<?php echo $datetime->get_raw( 'DTT_EVT_start' ); ?>"><?php echo $startdat; ?></td>

to:

<td class="start_date event-<?php echo $post->ID; ?>" data-value="<?php echo $datetime->get_raw( 'DTT_EVT_start' ); ?>"><?php espresso_list_of_event_dates( $post->ID ); ?></td>

and I also tried:

<td class="start_date event-<?php echo $post->ID; ?>" data-value="<?php echo $datetime->get_raw( 'DTT_EVT_start' ); ?>"><?php echo espresso_list_of_event_dates( $post->ID ); ?></td>

Am I missing something?


Tony

  • Support Staff

April 12, 2016 at 12:07 pm

Hi Robert,

I’ve just copied your template onto a test site and displayed all of the datetimes within the events for me: http://take.ms/0O9es

Were are you placing your custom template files?


Robert Zak

April 12, 2016 at 1:59 pm

Tony, it is placed in the uploads Folder, via FileZilla. It reflects all of the other changes I’ve made to the template, but it won’t show multiple date times on the table on our site.

For example, this is our mold assessor training page, which is a recurring class every Friday for a month. But here it only displays the first date.


Robert Zak

April 12, 2016 at 2:01 pm

More specifically, it’s here:

/wp-content/uploads/espresso/templates


Tony

  • Support Staff

April 12, 2016 at 2:09 pm

The output shown on this page: https://zotapro.com/ny-mold-program-training/assessor-initial-course/

Does not match the expected out from this template: https://gist.github.com/anonymous/aa58a0f931a6507bf5e98612b975a074

Is that the template that should be in place?

Even if for some reason espresso_list_of_event_dates() returned just a single date, it should have more formatting.

What is the full shortcode you are using for that output please?

Can you also post the full file path from /wp-content/uploads/ that you have placed the template.


Robert Zak

April 12, 2016 at 2:15 pm

I’m not quite sure what you are asking with some of these questions, but I will try to clarify.

The shortcode I am using is this:
[ESPRESSO_EVENTS_TABLE_TEMPLATE table_search=false order_by=start_date category_slug=mold-assessor-initial table_paging=false]

And like I said above, the full path is here:
/wp-content/uploads/espresso/templates


Tony

  • Support Staff

April 12, 2016 at 2:46 pm

You added that file path whilst I was replying, so I missed that above. However can you post the full filename to?

EE will check within your current themes root directory, then /wp-content/uploads/espresso/templates/ (then a couple of other locations within EE core but they should not be relevant in this case) and finally the plugin directory itself.

So if you have a copy of espresso-events-table-template.template.php within your themes root directory, that will load before /wp-content/uploads/espresso/templates/

The filename must match exactly in order for EE to find the file.

It appears that the template you are currently loading is not using the espresso_list_of_event_dates() function to display the dates.

The template you provided here does: https://gist.github.com/anonymous/aa58a0f931a6507bf5e98612b975a074

So here is how I would expect an event to output the date event with a single datetime – http://take.ms/l8K5P
(Ignore the register button, I’m testing translations)

That’s using the template you linked above, so either your loading a different template, or have removed the call for espresso_list_of_event_dates().


Robert Zak

April 13, 2016 at 7:46 am

The full file name I am using is:
espresso-events-table-template.template.php

I know that this is the file being pulled up to load on the site, since all of my other custom coding is working from this file as well (e.g. new columns, pricing, etc.)

And I just opened it again to double check. The call for
<?php espresso_list_of_event_dates( $post->ID ); ?>
is still there.

So I am really at a loss for why this isn’t working.

(On a side note, multiple dates and the calendar icons show up on the page where you actually select them number of tickets and proceed to checkout, they are just not displaying on the table.)


Tony

  • Support Staff

April 13, 2016 at 8:11 am

(On a side note, multiple dates and the calendar icons show up on the page where you actually select them number of tickets and proceed to checkout, they are just not displaying on the table.)

Yeah that’s using espresso_list_of_event_dates() and is how it should be displaying on the table view if using that function.

Can you send me ftp details so I can take a look?

If so use this form:

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


Tony

  • Support Staff

April 13, 2016 at 8:23 am

Or you could add something like this:

echo '<br/><h6 style="color:#2EA2CC;">'. __FILE__ . ' &nbsp; <span style="font-weight:normal;color:#E76700"> Line #: ' . __LINE__ . '</span></h6>';

Near to the top of the template file, it will output the templates current location and show where it was called from.


Josh

  • Support Staff

April 13, 2016 at 8:23 am

Robert,

Have you looked in your active theme folder for a copy of the same template?


Robert Zak

April 13, 2016 at 8:23 am

Filled out the form. Let me know if you have trouble logging in to anything.


Tony

  • Support Staff

April 13, 2016 at 8:37 am

So as you mentioned, the template file is correct.

However I added some code to the template to confirm it was actually loading and the page did not change, which got me thinking about caching.

This page: https://zotapro.com/ny-mold-program-training/assessor-initial-course/

Is being served from cache – http://take.ms/Dqjy4

If you create a new page and add the same shortcode to that page it should work as expected. The caching is likely server side caching setup by your host so you’ll need to contact your them to see how to clear the stale cache and have that page update (and excluded)


Robert Zak

April 13, 2016 at 8:43 am

I’m not sure it is a caching problem. What code did you add to look for changes? Every other change to the code I’ve made shows up on the site, so that doesn’t make sense to me.

I also tried making a new page with the same shortcode here, and it is the same problem still.


Tony

  • Support Staff

April 13, 2016 at 9:15 am

The code I added to the file was from above: https://eventespresso.com/topic/table-view-not-displaying-all-dates/#post-200061

I’ve also tried adding ‘- Test’ after the date – http://take.ms/1c9mf

That’s still does not show on the table.

Have you tried clearing the cache? Right now it’s the only other cause that I can find for this.


Robert Zak

April 13, 2016 at 9:30 am

We don’t have the ability to clear the cache directly, so I am contacting our server host. I will let you know if that changes anything.


Lorenzo Orlando Caum

  • Support Staff

April 13, 2016 at 10:36 am

Hello Robert,

I want to give you a heads up that forced-caching will cause sporadic issues with Event Espresso including registration problems so we recommend excluding the Event Espresso pages from the cache:

https://eventespresso.com/wiki/setup-nocache-exclusion-rules-event-espresso/

If your web host does not offer that option, then I recommend checking into a web host that does offer the ability to setup no-cache rules such as WP Engine:

https://eventespresso.com/requirements/


Lorenzo


Robert Zak

April 13, 2016 at 10:42 am

Lorenzo,

Our server host (WP Engine) no longer allows us to directly control caching, but we did send them Event Espresso’s specific pages that need to be excluded. This page isn’t one of those mandatory exclusions though. So I’m not sure what isn’t working.


Lorenzo Orlando Caum

  • Support Staff

April 13, 2016 at 10:45 am

Hi,

You can follow up with WP Engine support to have them add that page to the exclusion list.


Lorenzo


Tony

  • Support Staff

April 13, 2016 at 10:59 am

This page isn’t one of those mandatory exclusions though. So I’m not sure what isn’t working.

The standard routes are used across all installs of Event Espresso by default so we provide those as an example. If you use shortcodes that dynamically pull in data (like EE shortcodes) on other pages, they’ll need to be excluded, otherwise you’ll be server cached content rather than details pulled directly from the database.

In other words, any page you use EE shortcodes on will need to be excluded to have the latest information displayed.


Josh

  • Support Staff

April 13, 2016 at 2:32 pm

Hi there,

The reason your changes aren’t working is because there’s a copy of the /espresso-events-table-template.template.php template file in the root directory of your server. You can remove that one so that Event Espresso will use the other one in /uploads. Or you can modify the one in root.

As an aside, you can purge the cache from your WordPress dashboard by going to WordPress > WP Engine, then click the Purge All Caches button. To be clear though, the issue you’re seeing isn’t caused by caching. It’s being caused by having more than one of the espresso-events-table-template.template.php on your server, and the one located at root is the one being read.


Robert Zak

April 14, 2016 at 7:31 am

Josh, by having a copy in the root, are you referring to the original file here?

/wp-content/plugins/eea-events-table-view-template/templates

When I first started customizing the code, I followed several of Lorenzo’s tutorials where it said to copy the file here and upload a copy to

/wp-content/uploads/espresso/templates

where I proceeded to edit the file. I don’t know why this would cause a problem now, when it reads all of my other code changes properly. Or do you see a copy of this template somewhere else?


Tony

  • Support Staff

April 14, 2016 at 7:41 am

Hi Robert,

No that’s not where Josh is referring to:

/wp-content/plugins/eea-events-table-view-template/templates

Is the default template folder for the events view add-on.

‘Root’ would be the root directory of the website, where all of the files are placed. Its usually the location that will open when you log in via FTP (although not always, it depends on how the account was set up)

So this file – http://take.ms/xve5ub

That file is being loaded before any other template, so if there is a template there (like there is) it will override all of the others.

If you remove that file you will load the template from /wp-content/uploads/espresso/templates/


Robert Zak

April 14, 2016 at 10:12 am

Thank you all for clarifying. I am not sure how exactly a cope of the file got put there, but I removed it and now it is showing multiple dates.

The only problem is that now it is showing bullets, the dates, the times, and the calendar icon. I only want the date displayed (as it was before). Why did all of these things get put back in again/how do I remove everything extra besides just the dates?


Tony

  • Support Staff

April 14, 2016 at 10:57 am

That’s what <?php espresso_list_of_event_dates( $post->ID ); ?> outputs.

The only reason it wasn’t doing that before is because the template you had in root was not using espresso_list_of_event_dates().

If you only want the dates you’ll need to output that yourself rather than using espresso_list_of_event_dates(), so swap that out for something like this:

https://gist.github.com/Pebblo/4cf4b8efb25ada0187954c4d0e5d4a95


Robert Zak

April 14, 2016 at 11:03 am

I’m not quite sure what part of that code I am supposed to replace <?php espresso_list_of_event_dates( $post->ID ); ?> with. Can you explain how I’m supposed to use that code in the template?


Tony

  • Support Staff

April 14, 2016 at 11:09 am

You replace <?php espresso_list_of_event_dates( $post->ID ); ?> with all of the code I posted in that link, like this – http://take.ms/7Tdio

Here’s that template – https://gist.github.com/Pebblo/a2e7996e789e4dbff0dc98a9ebb7ffc7


Robert Zak

April 14, 2016 at 12:15 pm

Oh sorry, it was formatted so differently than the other columns’ sources, so I didn’t realize I needed to insert that whole code. It all seems to be working now! Thank you

The support post ‘Table View Not Displaying All Dates’ 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