5

I would like to override app/design/adminhtml/default/default/template/page.phtml

i'm currently using an extension that overrides app/design/adminhtml/default/default/template/page/header.phtml with a file in app/design/adminhtml/default/default/template/extname/page/header.phtml

i have recently made changes to the page.phtml file, but i would like to override it in the right way, but i'm not sure how. i was going through the codes to see how the extension developers override header.phtml but i cant figure it out.

can anyone tell me how to override this specific file?

4

Go to your extension's admin layout file or create one if you don't have yet.

default/default/layout/your_xml.xml

and add this in default section:

<layout>
    <default>
       <reference name="root">
          <action method="setTemplate">
              <template>your_path/page.phtml</template>
          </action>
       </reference>
    </default>
</layout>

I haven't tested but should work. Good luck.

37

You can declare a new primary theme for your admin area by customizing config (e.g. app/etc/local.xml) with the following:

<config>
    <stores>
        <admin>
            <design>
                <theme>
                    <default>your_theme</default>
                </theme>
            </design>
        </admin>
    </stores>
</config>

This will just set another level of fallback, and you can copy this and other custom templates/layout/etc under the right path in app/design/adminhtml/default/your_theme/

  • 2
    Thank you for this, this should be the accepted answer in my opinion as it allows for much easier modification of ALL adminhtml template files without having to explicitly configure a new view script for each file. – Darren Felton Mar 9 '16 at 21:29
  • 1
    It should be "<template>your_theme</template>". – hellcode Sep 29 '17 at 11:38
1

First of all I'm not believe this is the correct way of overriding adminhtml templates. But I try this approach and it works, So just wanna share.

Add this to your custom Module config.xml

<stores>
        <admin>
            <design>
                <theme>
                    <default>default</default>
                    <template>mycustom</template>
                </theme>
            </design>
        </admin>
</stores>

Now You can just override by copying templates from default to mycustom app\design\adminhtml\default\default\template\sales\order\view\history.phtml app\design\adminhtml\default\mycustom\template\sales\order\view\history.phtml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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