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

7ochem
  • 7,532
  • 14
  • 51
  • 80
John_iw2
  • 1
  • 1
  • 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 – Fabian Schmengler Apr 20 '16 at 07:55
  • Please refer to http://magento.stackexchange.com/questions/101501/override-magento-2-phtml-files/101502#101502 if you are looking for a solution for Magento 2.0 – Fabian Schmengler Apr 20 '16 at 07:56

2 Answers2

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.

Flyingmana
  • 6,127
  • 3
  • 27
  • 64
  • 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... – John_iw2 Dec 25 '13 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. – Flyingmana Dec 26 '13 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.