I tried to create an admin theme and make an override to sales module template file but this don't work, i followed those tutorials : create admin theme and Apply custom admin theme

in app/design/adminhtml/Vendor/customtheme, i created registration.php

 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
use \Magento\Framework\Component\ComponentRegistrar;
ComponentRegistrar::register(ComponentRegistrar::THEME, 'adminhtml/Vendor/customtheme', __DIR__);

in app/design/adminhtml/Vendor/customtheme/theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
     <title>Custom Theme</title> <!-- your theme's name -->
     <parent>Magento/backend</parent> <!-- the parent theme. Example: Magento/backend -->

In app/design/adminhtml/Vendor/customtheme/Module_Sales/templates/order/view/info.phtml i tried to add 'ddddd' in table header for customer acount data

  <?php foreach ($block->getCustomerAccountData() as $data):?>
                        <th><?= $block->escapeHtml($data['label']) ?> ddddd</th>
                        <td><?= $block->escapeHtml($data['value'], ['br']) ?></td>
                <?php endforeach;?>
                <?= $block->getChildHtml('extra_customer_info') ?>

After that i tried to create a module to apply the new theme admin

in app/code/Vendor/ThemeAdmin/registration.php



in Vendor/ThemeAdmin/composer.json

"name": "vendor/themeadmin",
"description": "new theme admin",
"require": {
    "php": "~5.5.0|~5.6.0|~7.0.0|~7.1.0|~7.2.0"
"type": "magento2-module",
"license": [
"autoload": {
    "files": [ "registration.php" ],
    "psr-4": {
        "Vendor\\ThemeAdmin\\": ""

In Vendor/ThemeAdmin/etc/module.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    <module name="Vendor_ThemeAdmin" setup_version="1.0.0">
            <module name="Magento_Theme"/>

In Wetag/ThemeAdmin/etc/adminhtml/di.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

<!-- Admin theme. Start -->
<type name="Magento\Theme\Model\View\Design">
        <argument name="themes" xsi:type="array">
            <item name="adminhtml" xsi:type="string">Vendor/customtheme</item>
<!-- Admin theme. End -->
  • You can override the required template in your custom module, is there any specific requirement of creating admin theme? Commented Mar 12, 2021 at 13:11
  • Did you run php bin/magento s:up after setup the new theme? Commented Mar 12, 2021 at 14:50
  • @RahulBarot i did this and it works but firstly i tried to create a new admin theme and override a module template but it doesn't work Commented Mar 12, 2021 at 15:04
  • @PetroChaikivskyi yes i did with clearing cache and command setup:di:compile Commented Mar 12, 2021 at 15:04

2 Answers 2


Template override is not working because you are overriding it in wrong directory, theme creation is fine.

In app/design/adminhtml/Vendor/customtheme/Module_Sales/templates/order/view/info.phtml i tried to add 'ddddd' in table header for customer acount data

It should be Magento_Sales, try renaming it and then check.


  • Thanks it works now Commented Mar 15, 2021 at 11:20

If you want to make a theme then do it in the design folder and also there is no need of creating a theme for running the di.xml file and also check the Magento luma theme in that also you won't find any di.xml file.

The theme contains only the view part of a module for a particular . That much think if wrong then please correct me

Please use a custom module and override it with that

Happy Coding

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.