2

I am trying to add a js file in my admin custom module. Here is my config.xml -

<config>
       ....                
<adminhtml>
        <layout>
            <updates>
                <inventory_uploads>
                    <file>uploads.xml</file>
                </inventory_uploads>
            </updates>
        </layout>
</adminhtml>
       ....
</config>        

app/design/adminhtml/default/default/layout/uploads.xml -

<layout>
    <adminhtml_uploads_index>
            <reference name="head">
                <action method="addJs"><script>uploads/jscolor/jscolor.js</script></action>
            </reference>
    </adminhtml_uploads_index>
</layout>

doesn't understand, what went wrong in this code.

Any help is appreciated.

2

Don't you forget include <?xml version="1.0"?> in your layout?

Try to determine if you layout working well. If your header will disappear - it will mean that layout loaded properly.

<layout>
    <adminhtml_uploads_index>
        <remove name="header" />
    </adminhtml_uploads_index>
</layout>

If it doesn't work - try this:

<layout>
    <default>
        <remove name="header" />
    </default>
</layout>

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.