0

How override a default phtml in Magento 2?

I want to update/improve the theme "magento_plushe". I add a file on app\design\frontend\magento_plushe\Magento_Theme\html\header.phtml But Magento ignore this file and load app\code\Magento\Page\view\frontend\html\header.phtml

Configuration: -Magento 2.0.0.0-dev55 -Cache disabled

2
  • 4
    I'm voting to close this question as off-topic because it is about a pre-alpha version of Magento 2 and no longer relevant Commented Apr 20, 2016 at 7:55
  • Please refer to magento.stackexchange.com/questions/101501/… if you are looking for a solution for Magento 2.0 Commented Apr 20, 2016 at 7:56

2 Answers 2

2

works in 2.0.0.0-dev57 as you tried.

But: if you want to create an improved design, you should create an own theme which extends from magento_plushe.

2
  • I found the problem. In var/maps/fallback Magento 2 keep the default path for the header.phtml. If I clean this folder fallback, Magento regenerate new correct path for header.phtml. Clear the cache in adminhtml don't clean the maps/fallback folder... Commented Dec 25, 2013 at 21:56
  • Problem is, this is not really a cache. Magento will soon introduce so called deployment scripts, which do a lot of stuff. This is one of the parts the deployment scripts will cover. Commented Dec 26, 2013 at 15:25
0

The correct path to override a base template file in your case would be /app/design/frontend/PackageName/ThemeName/Magento_Theme/templates/html/header.phtml

But, be careful when overriding base template files. Only do it when you can't do it with XML/CSS. It's always better to avoid this to have an easier upgrade path when Magento 2.x is updated.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.