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?
-
i don't know what magento is, but, can you modify the code? or is there some kind of management panel?Emre Türkiş– Emre Türkiş2015-07-02 10:54:53 +00:00Commented Jul 2, 2015 at 10:54
-
are you using default theme or rwd theme?Qaisar Satti– Qaisar Satti2015-07-02 10:56:31 +00:00Commented Jul 2, 2015 at 10:56
-
i am using the default themeSuraj U Gadhvi– Suraj U Gadhvi2015-07-02 10:57:04 +00:00Commented Jul 2, 2015 at 10:57
Add a comment
|
1 Answer
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>