# Overwriting template files from plugins

**URL:** https://discourse.roots.io/t/overwriting-template-files-from-plugins/18900
**Category:** sage
**Tags:** plugin
**Created:** 2020-08-13T19:07:09Z
**Posts:** 4

## Post 1 by @tomanthoni — 2020-08-13T19:07:10Z

I’m looking for one day and didn’t find an answer so I try here…

I want to use blade for overwriting template files from plugins in my Sage theme.

My case: I use the YARPP plugin to show related posts to the current post. I can use a shortcode for this.  
The documentation of the plugin says you can overwrite the html of the result if you copy a file in your theme. If I check this option the plugins copy the template file ‘yarpp-template-thumbnail.php’ to my resources folder.

But I want to use blade and use my other blade templates to include, use Controller code, …

I tried:

- renaming the template file to …blade.php
- Looked into the filter hook ‘template\_include’  
…

So in general, what is the way of working if you want to use the power of sage in template parts you want to override of plugins…

Thanks in advance!

---

## Post 2 by @tomanthoni — 2020-08-13T19:09:21Z

Or maybe a way is to use this template file that is suggested and include a blade file via php in this template file? To redirect to a blade file?

---

## Post 3 by @kac1per — 2020-08-27T03:00:32Z

Yes, you need to use this suggested template file.  
There you can “include” blade file using template() helper function.  
In your example ‘yarpp-template-thumbnail.php’ file should look like this:

```
<?php
use function App\template;
echo template('blade-template-name');
```

---

## Post 4 by @system — 2020-09-24T19:07:11Z

This topic was automatically closed after 42 days. New replies are no longer allowed.
