Magento – how to remove css files from a custom template

csslayouttheme

I am using a separate template file only for one category For that i have set up a separate page layout everything is working fine

content from my page.xml

<page_product_view_brand translate="label">
        <label>Product View (left)</label>
        <reference name="root">
            <action method="setTemplate"><template>page/product_view_brand.phtml</template></action>
            <!-- Mark root page block that template is applied -->
            <action method="setIsHandle"><applied>1</applied></action>


        </reference>
        <reference name="head">
            <action method="removeItem"><type>skin_css</type><name>css/screen.css</name></action>
        </reference>
    </page_product_view_brand>

This page is uses totally different css files. So i want to remove all the css that is loading other than my required ones.

But i am not able to remove the css from my document.What am i doing wrong

EDIT:
Two places in page.xml

<block type="page/html_head" name="head" as="head">
 <action method="addCss"><stylesheet>css/screen.css</stylesheet></action>
</block>
.....................
<block type="page/html_customhead" name="customhead" as="customhead">
 <action method="addCss"><stylesheet>css/screen.css</stylesheet></action>
</block>

Best Answer

You're best of adding any changes to the local.xml to ensure the new rules are processed last.

[...]
<page_product_view_brand>
   <reference name="head">
      <action method="removeItem"><type>skin_css</type><name>css/screen.css</name></action>
   </reference>
   <reference name="customhead">
      <action method="removeItem"><type>skin_css</type><name>css/screen.css</name></action>
   </reference>
</page_product_view_brand>
[...]

Should do the trick

Related Topic