Am I correct in assuming that /pub/static is rendered somehow by GruntJS and Less and this is an automated compilation of some sort - or can I directly edit these files or are they cache based? Would appreciate some light on how this renders and works?

I am looking for the default header.phtml files. So far I have only found 1column.xml and 2column.xml etc - I don't really like the XML files and editing them. I just want to access the raw header.phtml in the Blank theme if there is one and also some light on the above question


  • U should not edit these files.it will override next deploy.these are cached files
    – sivakumar
    Nov 8, 2015 at 13:54

2 Answers 2


There are two ways to put static files in /pub/static directory depending on application mode you using. You can find the mode using

./bin/magento deploy:mode:show

  • Developer and default modes use "pub/static.php" file to materialize static files in run time. Only files included in visited page will be deployed.
  • In production mode you need to execute "./bin/magento setup:static-content:deploy" command in order to materialize all static files.

However your phtml file is not static and wont be deployed here. The original file is located here app/code/Magento/Theme/view/frontend/templates/html/header.phtml. This file could be overridden in your theme.

  • Can you please elaborate further on your answer showing server examples of structure on if I changed a LESS file and also if I changed a live phtml file - do I need to run the deploy tool again or will Magento know? Real examples of development to live please and using grunt deploy. Feb 1, 2016 at 11:08

simple go to app/code/Magento/Theme/view/frontend/templates/html and copy the header.phtml and past to your theme in this path app/design/frontend/YouVendor/YouTheme/Magento_Theme/templates/html folder

if you using blank theme directly past inside app/design/frontend/Magento/blank/Magento_Theme/templates/html

Note: you can use the same technique for layout files , other choice for example if you not find folder templates and html you need create..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.