How can i add css/js using xml in magento


Add: CSS

from skin folder
<refrence name=”head”>
<action method=”addItem”>
<type>skin_css</type>
<name>css/styles.css</name>
<params/>
<if>lt IE 8</if>
</action>
</reference>

from js folder

<action method=”addItem”>
<type>js_css</type>
<name>zoom/style.css</type>
</action>
ADD: js

from skin folder

<action method=”addItem”>
<type>skin_js</type>
<name>js/zoom.js</name>
<params/>
<if>lt IE 7</if>
</action>

from js folder

<action method=”addJS”>
<script>varien/product.js</script>
</action>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~REMOVE~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

<remove name=”header”/>
<reference name=”head”>
<action method=”removeItem”>
<type>skin_css</type>
<name>css/styles.css</name>
</action>
<action method=”removeItem”>
<type>js</type>
<name>varien/product.js</name>
</action>
<action method=”removeItem”>
<type>skin_js</type>
<name>varien/product.js</name>
</action>
</reference>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s