Question

I am attempting to load a javascript file in my custom skin using the following code in local.xml.

<?xml version="1.0"?>
<layout>
   <default>
        <!-- remove some things that NKI doesn't use -->
        <reference name="head">
                <action method="addItem"><type>skin_js</type><script>js/nki.js</script></action>

        </reference>
   </default>
</layout>

Why does it first attempt to look in the base theme skin directory, then my directory?

I see it's attempting to load

The file exists in /var/www/skin/frontend/NKI/NKI/js/nki.js

I am a little confused. Maybe my method for loading using local.xml is outdated. Any suggestions? Maybe I have a setting wrong in admin?

EDIT: added local.xml location

app/design/frontend/NKI/default/layout/local.xml

Was it helpful?

Solution

your local.xml file is in wrong path. It should be inside

app/design/frontend/{package}/{theme}/layout/local.xml

In your case

app/design/frontend/NKI/NKI/layout/local.xml

In local.xml

<?xml version="1.0"?>
<layout>
   <default>
        <!-- remove some things that NKI doesn't use -->
        <reference name="head">
                <action method="addItem"><type>skin_js</type><name>js/nki.js</name></action>
        </reference>
   </default>
</layout>

It should be <name> instead of <script> tag

Hope it helps :)

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top