4

I'm using Magento 2 CE Version 2.1.2.

I have followed Magento StackExchange Questions/Answer for this.

Still having issues.

I would like to Override Magento 2: How to override Adminhtml "Shipping & Handling Information" Information Using Magento Admin Theme.

magento\app\design\adminhtml\Vendor\Themename\registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::THEME,
    'adminhtml/Vendor/Themename',
    __DIR__
);

magento\app\design\adminhtml\Vendor\Themename\theme.xml

<theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>My Theme Tile</title>
    <parent>Magento/backend</parent> 
</theme>

magento\app\code\Custom\Backend\registration.php

\Magento\Framework\Component\ComponentRegistrar::register(
        \Magento\Framework\Component\ComponentRegistrar::MODULE, 'Custom_Backend', __DIR__
);

magento\app\code\Custom\Backend\etc\module.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Custom_Backend" setup_version="2.0.0">
        <sequence>
            <module name="Magento_Theme"/>
        </sequence>
    </module>
</config>

magento\app\code\Custom\Backend\etc\di.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Theme\Model\View\Design">
        <arguments>
            <argument name="themes" xsi:type="array">
                <item name="adminhtml" xsi:type="string">Magento/backend</item>
            </argument>
        </arguments>
    </type>
</config>

magento\app\design\adminhtml\Vendor\Themename\Magento_Shipping\templates\order\view\info.phtml

echo "hi";
exit;

I have run below commands as well

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento indexer:reindex
php bin/magento cache:flush

What i'm still missing?

New theme entry shows in theme table

I'm in developer mode.

3

You should follow the Magento guide:

There is a note that your magento\app\code\Custom\Backend\etc\di.xml should be:

<type name="Magento\Theme\Model\View\Design"> 
<arguments> 
  <argument name="themes" xsi:type="array"> 
     <item name="adminhtml" xsi:type="string">Vendor/Themename</item> 
  </argument> 
</arguments> 
</type>
  • What i'm missing in above ones? – Ankit Shah Dec 2 '16 at 2:55
  • Don't need magento\app\design\adminhtml\Vendor\Themename\Magento_Shipping\etc\module.xml, magento\app\design\adminhtml\Vendor\Themename\Magento_Shipping\etc\di.xml. We need to create a new module to apply the custom theme – Khoa TruongDinh Dec 2 '16 at 2:57
  • How & where to check your New Admin Theme is applied? I would like to override that Shipping Block so i need to remove that? – Ankit Shah Dec 2 '16 at 3:07
  • magnto/app/code/Custom/Backend/etc/module.xml In <sequence><module name="Vendor_Themename"/></sequence> or <sequence><module name="Magento_Backend"/></sequence> – Ankit Shah Dec 2 '16 at 3:09
  • Use <sequence><module name="Magento_Theme"/></sequence>. – Khoa TruongDinh Dec 2 '16 at 3:15

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.