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

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

General

Customize plugin template outside theme

Started by Robert 8 years ago · 1 replies · 526 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 Jerry Hunt, 4 days ago
2 85 13 hours ago
General · by pamtbaau, 18 hours ago
1 60 18 hours ago
General · by Andy Miller, 1 day ago
0 47 1 day ago
General · by Marcel, 12 months ago
6 350 5 days ago
General · by Duc , 6 days ago
3 44 5 days ago