Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Customize plugin template outside theme

Started by Robert 8 years ago · 1 replies · 666 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 jeremycherfas, 1 week ago
4 182 2 days ago
General · by lynbor, 6 days ago
2 124 3 days ago
General · by Old Man Umby, 1 week ago
1 100 1 week ago
General · by Sebastian, 2 weeks ago
1 124 2 weeks ago
General · by Andy Miller, 3 weeks ago
0 248 3 weeks ago