Fairly new to Magento 2. Working from a cloned version of another site and trying to make simple, cosmetic changes to the custom theme homepage here:


Any change I make manifests immediately, but unrelated parts of the page break at the same time. Most of what's in page-header disappears, and a new div called nav-sections appears with all our categories in it.

These exact changes occur regardless of how I alter default.xml -- even adding a character to a string causes them.

My hunch is it's a question of workflow, and I'm still unclear about when and how Magento 2 decides to create and serve files from pub/static, generated, and var/generated.

I should also note that I'm making these changes in production mode, and that running deploy doesn't fix anything.

What am I doing wrong here?

  • In production mode, you need to deploy the static-content every time you make changes ! command : php bin/magento setup:static-content:deploy
    – PЯINCƎ
    Commented Mar 21, 2018 at 15:23
  • Thanks, but the layout breaks even before running the deploy command, and stays broken after running it.
    – mxtthxw
    Commented Mar 21, 2018 at 16:36

2 Answers 2


I think that you have removed some properties from your custom default.xml or you have some errors on it please try this:

  1. Copy the original default.xml from the parent theme to the custom one.
  2. Clear the content folder of : pub/static, var/view_preprocessed, var/cache

  3. Launch this command : php bin/magento setup:static-content:deploy -f

  4. Check line by line the property who breaks you layout.


It's simple solution.

by default Magento 2 just join file so core file with your get compile to one.

Block and component with are initialize with the same name as core will dissapear (after copying to theme folder).

You need to replace name in: app/design/frontend/Vendor/Theme/Magento_Theme/layout/default.xml

Change name attribute only in: <block... or <container... References don't need to be fixed. Be sure that name is uniquely across system.


From: <block class="Magento\Theme\Block\Html\Title" name="page.main.title" template="Magento_Theme::html/title.phtml"/>


<block class="Magento\Theme\Block\Html\Title" name="custom.page.main.title" template="Magento_Theme::html/title.phtml"/>

WARNING: This will create new block after existing one. If you need to replace then replace <block... to <referenceBlock... as described in http://devdocs.magento.com/guides/v2.0/frontend-dev-guide/layouts/xml-instructions.html

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.