The Events Calendar and Sage 9 (blade)

Not exactly, but for what we need and since we heavily customize the templates anyway, just including something this on whatever events template you set (I usually set the default option the way @MWDelaney mentioned) works for our need:

@include('tribe-events.'. basename(tribe_get_current_template(),'.php'))

I’m curious if you’ve used this on Sage 10 or recently with The Events Calendar. I’m having issues getting blade to work with it. I’ve tried adding Tribe__Settings_Manager::set_option( ‘tribeEventsTemplate’, ‘views/template-events.blade.php’ ); to app/theme/filters.php. I’ve tried adding the default template, but it didn’t work. I would greatly appreciate your help if you have any insight. Thank you.

This is what I use for sage 9. It works, but i’m not happy with it. TEC 5 has a new template engine and hooks that might allow a nicer solution.

This worked for me but here is a hint… Make sure you clear the _transient_tribe_cache… entries in the database because the changes you make in the templates in [theme]/resources/ will not show when developing locally. I spent several hours figuring this out so I hope it helps someone else…

I solved this by creating an events.blade.php in the resources folder.

I then pasted the following:

{{--
  Template Name: Events
--}}

<?php use Tribe\Events\Views\V2\Template_Bootstrap; ?>

@extends('layouts.fullwidth')

@section('content')
  <div id="tribe-events-pg-template">
	<?php echo tribe( Template_Bootstrap::class )->get_view_html(); ?>
  </div> <!-- #tribe-events-pg-template -->
@endsection

And this replicated the same content seen on the default-template.php override in the V2 edition of the plugin. It has all functionality includeing the nice styling, datepickers etc.

Hope that helps!

Phil

4 Likes

Is this working on Sage 10? I dropped this in and can select the template within TEC settings, but cant include any partials from here. Is there something else that I’m missing? Seems that a lot of the stuff talked about in the above comments pertain to sage 9.

I don’t think this will work for sage 10. There’s a lot changed in sage 10 and the events calendar as well. The code I posted is made for the ‘old’ (the not /v2/ templates) the event calendar templates.
The new the events calendar template logic has more useful hooks I assume, but I haven’t takem an a look at it.

1 Like

Sage10 support for The events calendar v2 templates. This is a work in progress but at least it works.

2 Likes

A recent TEC update broke my method above. This is the better solution! Thank you for this!

1 Like

I’m running into an issue getting TEC to run in my Sage 10 environment. Currently trying to get things working using the supermundano/sage-the-events-calendar package. However, I’m stuck on the wp acorn vendor:publish --tag="TheEventsCalendar Templates" step. When I run it, I get the following error in my console:

In VendorPublishCommand.php line 277:
                                                                        
  Call to undefined function Illuminate\Foundation\Console\base_path() 

Just curious if you or others have encountered this error. Not sure where I’m going wrong.

EDIT: Is it possible the supermundano/sage-the-events-calendar package is intended to be used within the Roots Bedrock environment? I’m not using Bedrock; not sure if that’s related to this issue or not.

Having same problem, but I’m using bedrock (and Trellis).

Using Sage 10, I did a composer require supermundano/sage-the-events-calendar in the Sage root directory (not Bedrock in this case, correct?).

I logged into via trellis ssh development, cd /srv/www/example.com/current, and the wp acorn package:discover seemed to go OK (it discovered the plugin), but I got the exact same error.

Being pretty uniformed about acorn at the moment, I pretty much don’t have a clue what to do next.

Were you able to come up with any solutions?

I believe the publish step simply moves the default-template.blade.php into [your-theme]/resources/views/tribe/events/v2/, so if the publish step isn’t working for you, you can do it manually.

(I was running into some issues after that due to running things in Windows environment locally (Windows file paths can have back slashes instead of forward slashes), but the plugin should be updated now to work with both Mac/Linux and Windows.)

1 Like

And I believe you are correct about composer installing it into the Sage theme root directory, as that’s what I did. I’m not running Bedrock, nor Trellis.

3 Likes

Does anyone have a step by step way to get this work with Sage9 (yes, 9, not 10). I have a Sage 9 site that needs TEC

What is not working from the steps already provided in this topic?

wow thanks this was super helpfull for getting V2 to work!