cancel
Showing results for 
Search instead for 
Did you mean: 

Adding new block inside Magento_Theme folder

Adding new block inside Magento_Theme folder

I want to add a new block inside the Magento_Theme

I inserted the block tag inside 

Theme/Magento_Theme/layout/default.xml

 

 

<block class="Magento\Framework\View\Element\Template" name="partners.stores.navigation" template="partners_stores.phtml">

 

Then created

Theme/Magento_Theme/templates/partners_stores.phtml

But I got this

Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'partners_stores.phtml' in module: '' block's name: 'partners.stores.navigation'

Is there something wrong?

1 REPLY 1

Re: Adding new block inside Magento_Theme folder

You need to keep below code in an XML file,

Use, 

template="Magento_Theme::partners_stores.phtml"
<block class="Magento\Framework\View\Element\Template" name="partners.stores.navigation" template="Magento_Theme::partners_stores.phtml">

 

If Issue Solved, Click Kudos/Accept As solutions. Get Magento insight from
Magento 2 Blogs/Tutorial