Using The Events Calendar with Sage 10


I try to get The Events Calendar by Modern Tribe working with Sage 10. But don’t know how to get it functional. Loading the plugin files as blade is not so important to me. I’m looking for a way to include it in the app.layouts, so it’s loading with header and footer. I tried to use:

  Template Name: Events


  <div id="tribe-events-pg-template">
	<?php tribe_events_before_html(); ?>
	<?php tribe_get_view(); ?>
	<?php tribe_events_after_html(); ?>
  </div> <!-- #tribe-events-pg-template -->

But it’s not working for all views. Anybody got an idea?

I took a look at the Woocommerce integration for Sage 10:

For Sage 9 I found:



namespace App\Plugins;

use function App\template;

class EventsCalendar
    public function run(): void

    public function addFilters(): void
        add_filter('tribe_get_current_template', [self::class, 'setupTemplates'], PHP_INT_MAX);
        add_filter('tribe_get_template_part_path', [self::class, 'setupTemplates'], PHP_INT_MAX);

    public static function setupTemplates(string $original_template): string
        $template = basename($original_template);
        $view = basename(dirname($original_template));
        $view_template = "{$view}/{$template}";
        $data = collect(get_body_class())->reduce(function ($data, $class) use ($template) {
            return apply_filters("sage/template/{$class}/data", $data, $template);
        }, []);
        $location_paths = [
        $template = \App\locate_template($location_paths);

        if ($template) {
            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
            echo template($template, $data);
            return get_stylesheet_directory() . '/index.php';

        return $original_template;

This topic was automatically closed after 42 days. New replies are no longer allowed.