How to override adminhtml phtml files in magento2?

I want to place a custom text in customer edit page welcome to magento2. For this I have created a theme and placed


<?php echo $block->getChildHtml(); ?>

but it's not working, when I place the same in app\code\Magento\Customer\view\adminhtml\templates\tab\view.phtml then it's working.

  • 1
    Do you enable custom theme for adminhtml aria? – KAndy Oct 15 '15 at 14:34
  • did you get that working? – Philipp Sander Apr 21 '16 at 14:06
  • @PhilippSander for adminhtml template files we have to create seperate theme for admin and edit template files same as front end module based structure – prasad maganti Apr 25 '16 at 9:15
  • thanks! already solved it myself with a different approach – Philipp Sander Apr 25 '16 at 13:17
  • 6
    If you have solved, you should share how you solved it. That's how a community works. – rbncha Jul 12 '16 at 17:39

adminhtml phtml file can be override as steps below

STEP 1: Add page layout XML in custom module.


<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="admin-2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceBlock name='order_totals'>
      <action method="setTemplate">
        <argument name='template' translate="true" xsi:type='string'>[Vendor]_[Module]::order/totals.phtml</argument>

STEP 2: Put template file on below path


Write custom code with existing content!!!

Hope ot will work for you :)

| improve this answer | |

I created a new module and copied the file to


it works.

| improve this answer | |
  • This will not work. – Girish SH Aug 8 '18 at 13:41

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.