getgrav / grav-plugin-feed

Grav Feed Plugin
https://getgrav.org
MIT License
16 stars 11 forks source link

Override feed twig #30

Closed jgonyea closed 7 years ago

jgonyea commented 7 years ago

What's the proper way of overriding a twig template used by a plugin? If someone wanted to create their own rss.html.twig, where would they put it within their plugin and call it?

I see at https://learn.getgrav.org/admin-panel/extending for how to override an admin template, but I'm looking for how to override another plugin's template.

Thanks in advance.

rhukster commented 7 years ago

The best way is to create a copy of the appropriate feed twig file in your theme's templates/ folder. Once copied, you can edit it there and it should override the file provided by the plugin.

jgonyea commented 7 years ago

Thanks, I kept putting it into myplugin/OTHERPLUGIN/templates to sort of match the admin-panel extending documentation.

For anyone else coming here: I used https://learn.getgrav.org/forms/blueprints/example-page-blueprint#in-a-plugin and the template was overridden by my plugin's template.