wordpresstimber

Using Timber with the updated Calendar designs in The Events Calendar Plugin


I'm using the events calendar plugin for Wordpress with a Timber based theme. I'm currently using a previously documented method to integrate which is here:

https://theeventscalendar.com/support/forums/topic/events-pages-not-showing-up-in-timber-based-theme/

Since v5 of the plugin there is an option [set to default too] which uses the updated calendar and event designs that breaks my current integration method. I've tried to update my template PHP files but with little success.

The legacy functions which are relatively simple to call using the function() method in Timber are:

<?php tribe_events_before_html(); ?>
<?php tribe_get_view(); ?>
<?php tribe_events_after_html(); ?>

https://timber.github.io/docs/guides/functions/

However in the v2 templates added to The Events Calendar in v5 they are calling a class, e.g:

use Tribe\Events\Views\V2\Template_Bootstrap;

get_header();
echo tribe( Template_Bootstrap::class )->get_view_html();
get_footer();

The main problem I have is that I'm unsure how to expose this class to the Timber context. If anyone could give me a steer it would be much appreciated. What I have now works fine but the tribe_get_view function is deprecated and considered legacy so is not going to be around for ever so I need to come up with some sort of solution.

Thanks!


Solution

  • Right so the method I posted is no longer require at all and neither is a work around. Just make sure you have a page-plugin.twig template available. Hopefully this will help anyone else who ends up in a bit of a rabbit hole.....