-
-
Save Log1x/d02f35f6f9de5f1a5078a3807c6a36c2 to your computer and use it in GitHub Desktop.
The Events Calendar (Sage 10)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# events/default-template.blade.php | |
@extends('layouts.app') | |
@section('content') | |
{!! tribe( | |
\Tribe\Events\Views\V2\Template_Bootstrap::class | |
)->get_view_html() !!} | |
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Illuminate\Support\Str; | |
use function Roots\view; | |
add_filter('tribe_template_file', function ($file) { | |
$path = str_replace('/', '.', Str::after(basename($file, '.php'), 'v2/')); | |
return view()->exists("events.{$path}") ? | |
view("events.{$path}")->makeLoader() : $file; | |
}); |
Nice. I've never used The Events Calendar before so I didn't know if any of this was still relevent.
Could swap Str::replace()
to Str::before($file, '.php')
maybe.
I try not to use it if at all possible. :) It's a headache in so many ways.
This snippet gets me most of the way there for a basic install, and for anything else, I reach for supermundano/sage-the-events-calendar, which has its own limitations.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I made a slight adjustment to filter function, as
basename
was stripping the path as well as the file extension:ℹ️ Note that this will look for add-on views in the base
tribe
directory. For example:tribe-events/tickets/v2/list/event/cost.php
should now betribe/list/event/cost.blade.php
.