Customize plugin template outside theme

I want to customize a twig partial template that is provided by a plugin. And be able to use this regardless of the theme I am using. So the custom twig cannot reside in /user/themes/mytheme/templates/partials/.

Is there a location where I can store custom twig templates, that I can use with ANY of my templates? Which path is evaluated in the Grav lifecycle, of course.

For example /user/templates/partials/, more or less like /user/languages for language overrides?

As far as I know, no. There is no generic folder for template files. I’m pretty sure you could create a plugin that injects such a folder into the search stream, but I’ve never done anything like that. See the Grav Lifecycle, specifically the onTwigTemplatePaths event.

There’s also a File Content plugin.

1 Like