3

I'd copying root.phtml (from vandor/magento/module-theme/view/base/) in to my theme (app/design/frontend/Vendor/MyTheme/Magento_Theme/templates/root.phtml). All pages root templates is override except product page.
I am using Magento v 2.2.2 The Parent theme is "blank". I will be grateful for help.

2
  • Did you tried setup:static-content:deploy command? & what changes you are expecting into your product page put some hints so that you can get proper help from someone Commented Dec 20, 2017 at 16:08
  • Yes, I cleared cache, and tried setup:static-content:deploy command. but this does not give a result. I need to override root template for rewrite doctype head and body tags. It's need for create Amp theme. Commented Dec 20, 2017 at 16:18

1 Answer 1

2

I just did the same thing and did not have a problem. The changes applied for every page I tested. Perhaps you have another module that is supplying an override for the product page? Or perhaps your product page layout is using some other layout that is not using root [just a crazy guess]?

Or perhaps you can update your module's di.xml to replace this default config, provided by the di.xml in magento2-base\app\etc, with an entry that point to the root.phtml in your module?

    <type name="Magento\Framework\View\Result\Page">
    <arguments>
        <argument name="layoutReaderPool" xsi:type="object">pageConfigRenderPool</argument>
        <argument name="generatorPool" xsi:type="object">pageLayoutGeneratorPool</argument>
        <argument name="template" xsi:type="string">Magento_Theme::root.phtml</argument>
    </arguments>
</type>
1

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.