1

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

3
  • can you please update your question with local.xml file path? Commented Sep 8, 2017 at 18:07
  • I've added the location of layout.xml. Commented Sep 8, 2017 at 18:11
  • 1
    its local.xml not layout.xml. I Edited your question Commented Sep 8, 2017 at 18:21

1 Answer 1

2

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 :)

2
  • Those were some spot-on suggestions. I made those changes, and things magically started working. Commented Sep 8, 2017 at 18:34
  • Glad to know that its working fine Commented Sep 8, 2017 at 18:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.