Question

The RWD theme has several JQuery files such as rwd/default/js/app.js

I need to extends some of the functionality in this file, but it's not possible to do this in the traditional way that prototype does (Object.extend etc). Is it just a case of copying the file into my theme and doing as I please? Is this the accepted way of doing this type of work?

Was it helpful?

Solution

I guess at least there are two options for your case.

  1. If you want to rewrite it, you should make a copy of this file to you custom theme to avoid directly editing core file. It should be under js folder like that: your_thems/js/app.js then you can edit that one.

  2. Create your custom extension file, you can put it in skin folder or js folder depended on you flavour. Then inserting this file through local.xml. Finally, you can do your magic here.

an example: check here. That's the way to add a custom extension js in local.xml file. Hope it help you somehow.

<reference name="head">
    <action method="addJs"><script>js/my_app.js</script></action>
</reference>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top