Posted: 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:
to:
and I also tried:
Am I missing something? |
|
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? |
|
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. |
|
More specifically, it’s here: /wp-content/uploads/espresso/templates |
|
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. |
|
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: And like I said above, the full path is here: |
|
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 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(). |
|
The full file name I am using is: 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 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.) |
|
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: |
|
Or you could add something like this:
Near to the top of the template file, it will output the templates current location and show where it was called from. |
|
Robert, Have you looked in your active theme folder for a copy of the same template? |
|
Filled out the form. Let me know if you have trouble logging in to anything. |
|
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) |
|
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. |
|
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. |
|
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. |
|
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, 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. |
|
Hi, You can follow up with WP Engine support to have them add that page to the exclusion list. — |
|
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. |
|
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. |
|
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? |
|
Hi Robert, No that’s not where Josh is referring to:
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/ |
|
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? |
|
That’s what 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 |
|
I’m not quite sure what part of that code I am supposed to replace |
|
You replace Here’s that template – https://gist.github.com/Pebblo/a2e7996e789e4dbff0dc98a9ebb7ffc7 |
|
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.