1

I am trying to add a CSS file in Magento admin section. Using following code in local.xml, I have added one JS file :

<layout>
    <default>
        <reference name="head">
            <action method="addItem">
                 <type>skin_js</type>
                     <name>my_folder/my_js.js</name>
                 <params/>
            </action>
        </reference>
    </default>
</layout>

But I not able to attach a CSS file in admin section.

4
  1. Go to skin/adminhtml/default/default and place your file under module/custom.css
  2. Go to app/design/adminhtml/default/default/layout and create the file module.xml with the following code:
<?xml version="1.0"?>
<layout>
    <default>
        <reference name="head">
            <action method="addCss">
                <name>module/custom.css</name>
            </action>
        </reference>
    </default>
</layout>
  1. Now connect your xml file to the module in Namespace/Module/etc/config.xml:
<config>
...
<adminhtml>
    <layout>
        <updates>
            <namespace_module>
                <file>module.xml</file>
            </namespace_module>
        </updates>
    </layout>
</adminhtml>
...
</config>

Hope this will help you

1

Please check below reference Url.

http://magebase.com/magento-tutorials/5-useful-tricks-for-your-magento-local-xml/ http://blog.belvg.com/use-a-local-xml-file.html

Hope this will help you.

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.