0

i am new to Magento i wanted to add custom CCS and jQuery to the body of home page , how can i do that ,please some one explain the procedure step by step or can provide me with links?

3
  • i don't know what magento is, but, can you modify the code? or is there some kind of management panel? Commented Jul 2, 2015 at 10:54
  • are you using default theme or rwd theme? Commented Jul 2, 2015 at 10:56
  • i am using the default theme Commented Jul 2, 2015 at 10:57

1 Answer 1

1

You need to create local.xml in your current theme layout folder and add the following code to add custom Js and css on home page only:

<?xml version="1.0"?>
<layout version="0.1.0">
<cms_index_index>
        <reference name="head">
            <action method="addJs"><script>custom.js</script></action> // JS file must be place in Root JS folder
            <action method="addCss"><stylesheet>css/custom.css</stylesheet></action> // CSS file must be in current theme folder
        </reference>    
</cms_index_index>  
</layout>

If you want to add this CSS and JS on all pages you need to change handler from <cms_index_index> to <default>

Sign up to request clarification or add additional context in comments.

Comments

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.