Skip to content
Grav 2.0 is officially stable. Read the announcement →
General

Customize plugin template outside theme

Started by Robert 8 years ago · 1 replies · 627 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 jean-louis67, 3 weeks ago
2 308 3 weeks ago
General · by Andy Miller, 3 weeks ago
0 311 3 weeks ago
General · by Veehem, 4 weeks ago
0 263 4 weeks ago
General · by milkboy, 4 weeks ago
0 265 4 weeks ago
General · by ian russell, 1 month ago
2 335 1 month ago