Loading plugin views. Add a location to look for blades?



I ask a lot of annoying questions on this forum.

When I build feature plugins for my sites I like to include views with them so I’m not creating too many interdependencies between my theme and plugins.

In the past I’ve used Gamajo Template Loader to let the plugin keep its own views, and let the theme override them, like WooCommerce and other plugins do.

But this method doesn’t work with Blade templates because Sage’s blade functionality isn’t called when Gamajo does its magic.

A solution to this would be to allow Sage’s Blade implementation to accept a path to look for views in the plugin directory. It would check the theme first for an override, and fall back to the plugin path.

It would be easy enough to check for Blade functionality in the plugin before including a view, and besides that I’m much more comfortable having a plugin require Sage9 (any Sage9) than I am requiring specific template files within that Sage9 theme.

So what do you think? Is this possible now? Is it a good feature suggestion if not?

Thanks for reading.


Did you see this section?


I have seen that, and I want to do sort of the reverse. I want the plugin to tell the theme about its views, rather than the other way around.

I guess I could wrap that in a filter and use that, though.

I’ll see if that works. Thanks!