Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Customize plugin template outside theme

Started by Robert 8 years ago · 1 replies · 855 views
8 years ago

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?

8 years ago

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

Suggested topics

Topic Participants Replies Views Activity
General · by themetman, 24 hours ago
2 40 17 hours ago
General · by Hanns Mattes, 1 week ago
0 121 1 week ago
General · by Karmalakas, 1 week ago
2 185 1 week ago
General · by Hanns Mattes, 3 weeks ago
0 235 3 weeks ago
General · by Dima, 4 weeks ago
1 211 4 weeks ago