3

I want to add a custom layout xml file to update adminhtml. I have it working now by adding the xml file to app/design/adminhtml/default/default/layout/[module]/custom.xml. I don't like adding this file to the default/default folder however.

Is it possible to add it to [custom]/[theme] instead of default/default ?

  • Means you want to create a new admin theme for this ? – Anil Suthar Jul 26 '16 at 10:23
  • Is that the way to go? Or is it overkill? – mlippie Jul 26 '16 at 10:50
  • check my answer below – Anil Suthar Jul 26 '16 at 11:00
1

I think, there's no problem OR any issue to put custom.xml in default/default.

As you want to put custom.xml in [custom]/[theme] (don't know why), it's clear that you have to create an admin theme. For this edit app/etc/local.xml and put below code in :

<config>
    <stores>
        <admin>
            <design>
                <!-- IF YOU WANT TO CREATE AN ADMIN PACKAGE, UNCOMMENT THIS 
                <package>
                    <name>your_admin_package_name</name>
                </package>
                -->
                <theme>
                    <default>your_admin_theme_name</default>
                </theme>
            </design>
        </admin>
    </stores>
</config>

Now you can put your custom.xml at app/design/adminhtml/default/your_admin_theme_name/layout/[module]/custom.xml.

If you have created an admin package then put custom.xml at app/design/adminhtml/your_admin_package_name/your_admin_theme_name/layout/[module]/custom.xml

  • Thanks! The reason why I would want to do this is just to keep the default magento files seperate from my updates and customizations. – mlippie Jul 26 '16 at 11:07
  • Yes, as you know, if you update/upgrade Magento, files at app/design/adminhtml/default/default/layout/[module]/*.* will NEVER be overwritten. So putting files at default/default/layout/[module]/ location is not a problem. Thought I provided a solution that will work for you. – Anil Suthar Jul 26 '16 at 11:12
  • @mlipie: Have you tried this solution ? – Anil Suthar Jul 28 '16 at 12:10
  • No, I haven't tried it. I chose to just do it in default/default anyway. I realized there indeed isn't a good reason to make a new theme for this. – mlippie Jul 28 '16 at 12:38
  • Yes, that's a good thing to go in default/default – Anil Suthar Jul 28 '16 at 12:49

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.