Try the Demo

Magento Forum

   
Problem with layout xml, addJs method, and my own custom JavaScript file
 
junglemason
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-05-16
Portland, OR
 

In the file app/design/frontend/default/junglemason/layout/catalog.xml if I make any changes, nothing happens.  Apparently it’s not getting used.  How can I make sure my custom layouts are being used?

In the file app/design/frontend/default/default/layout/catalog.xml my changes do affect the product page.  But when I try adding <action method="addJs"><script>junglemason/imageslider.js</script></action> to <catalog_product_view><reference name="head"> it does not add the script to the page.

I added a var_dump and die to Head.php to see if anything was going through, and it is.  But the page will still not include my js file.  What could be wrong?

 
Magento Community Magento Community
Magento Community
Magento Community
 
somesid
Sr. Member
 
Total Posts:  83
Joined:  2008-06-20
 

First if you want to use another theme you need to specify to magento to use you junglemason theme: more about that here : http://www.magentocommerce.com/wiki/how-to/designing/designing-for-magento

Then about your js, be sure that your file is in /js/junglemason/imageslider.js

then the correct line should be :

<action method="addJs"><script>junglemason/imageslider.js</script></action>

Don’t forget to clean your cache (or even disable it) when you modify .xml (delete everything in /var/cache/).

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top