1

I am trying to get rid of a css file, which constantly is being loaded but I don't use dates anywhere in the frontend. It seems I can't erase this file no matter what but it blocks my rendering on each site...

Yes, I could just delete the code of the css file but my browser would still make one extra request to load the blank file.

/js/calendar/calendar-win2k-1.css

I tried editing the local.xml of my own theme to remove this file:

<layout>
  <default>
    <reference name="head">
       <action method="removeItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name></action>
     </reference>
  </default>
</layout>

But that does not change a thing. Then I saw the same problem with a possible solution and tried to copy it:

I tried Rajeev's approach to create a module and remove the file in an own custom layout update, however even though my module and custom layout update work (I have succesfully tried adding other example files in the head with my module), the file won't disappear.

1

Please, try :

<layout>
    <catalog_product_view>
        <reference name="head">
            <action method="removeItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name></action>
        </reference>
    </catalog_product_view>
    <catalogsearch_advanced_index>
        <reference name="head">
            <action method="removeItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name></action>
        </reference>
    </catalogsearch_advanced_index>
</layout>

For some reason, it doesn't work with the default handle.

  • Thanks for the suggestions, I tried but that did not fix it, I also think that the css path is already covered via the <type> declaration. – TheFrakes Mar 9 '18 at 15:43
  • Well, I was thinking like you for the css path. But I looked in some of my own project, and it works only if I add it. Oh ! I think I got it : as your file in in the js folder : could you try with js instead of css? – Julien Loizelet Mar 9 '18 at 15:58
  • Also tried this alteration but no effect either... – TheFrakes Mar 12 '18 at 13:32
  • I tried with a Magento 19.3.6 version. It seems that it's not working as expected on the default handle but it's working on the catalog_product_view handle. I update my answer again with something that worked for me. – Julien Loizelet Mar 12 '18 at 15:25
  • It worked! Thanks a lot, do you want to elaborate? – TheFrakes Mar 15 '18 at 11:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.