I want to get a specific template file rendered/populated through Blade.
In the class, I need to replace the (old?) (new Template(new Wrapper($template)))->layout(); to something that works with the latest Sage9
My template path seems correct (using locate_template); however I tried with both template_include filter and echo App\template(): both seems to interpret PHP just fine but output any blade statements without interpreting them i.e. raw text outputs appear in the page like “@extends(‘layouts.app’)”; there must be something I’m doing that is wrong
It now shows a page withe the element but no css and overrides my custom templates to render the custom query.
When I output what the helpers’ template function received: it shows the $file twice for a single request; the first output looks good (it’s my custom template file location); the second time it reverts to the default index.blade.php
I should probably look into Cortex more to better understand how this works.
Btw, the book along the blog, discourse and the slack chan are such precious tools to learn more; my brain felt a joyful overdrive trying to pierce the logic to render templates. Thank you so much for all the work!
First of all I apologize for my English level, I hope we can understand each other.
I have the same problem as you, the solution proposed in the thread,
it does not work for versions 9.1. * of Sage, but I do not understand the solution proposed by @alwaysblank, did it finally work for you? How did you do it?
Hey Zacarias, sorry I missed the thread on Github
this is the route that worked in the end—as you can see it doesn’t use a custom template, just the normal route and Sage will pick up the template based on the post type. Hope this helps!