cancel
Showing results for 
Search instead for 
Did you mean: 

Applying custom 'core' phtml files to a theme

SOLVED

Applying custom 'core' phtml files to a theme

In Magento 1 if I wanted to modify my own version of a phtml file I would move it into the theme directory, while maintaining the same structure. I have needed to do this on a single Magento instance that has multiple store views and uses different themes.

 

An example would be
app/design/frontend/base/default/template/page/html/breadcrumbs.phtml
Being added into
app/design/frontend/argento/<my_theme>/template/page/html/breadcrumbs.phtml

 

When viewing the website, my updated template would be used and not affect any other store views I have.

This method didn't require any xml updates, or technical wizardry, which suited me perfectly.

 

---------------

 

Magento 2 seems to be structure quite differently

The breadcrumbs file is held within
vendor/magento/module-theme/view/frontend/templates/html/breadcrumbs.phtml
A slider file is here
app/code/Swissup/EasySlide/view/frontend/templates/slider.phtml

 

Where would these need to be placed to display using my own theme, which is below
/app/design/frontend/Local/<my_theme>

1 REPLY

Re: Applying custom 'core' phtml files to a theme

I don't know about your setup and different store views, but I overwrite core files simply by copying them into my theme with the same directory structure, replacing module-theme with Magento_Theme and so on.

 

So to change the module-theme directory, the directory would be:

 

/app/design/frontend/YourName/ProjectName/Magento_Theme

 

Add subdirectories and .phtml files to match the original module-theme as needed.