Sign up ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I am trying to replace all external CSS and JS files path in Magento. What is the best way to do it? Using any observer?

For example, http://magentotest.localhost/skin/frontend/rwd/default/css/styles.css would become http://magentotest.localhost/min/?f=skin/frontend/rwd/default/css/styles.css

Just trying the Minify library.

share|improve this question
    
Maybe consider using the merge css and merge js options magento has, this way you will have to minify only 1 css file and 1 js file. –  raduparvan Sep 17 at 14:36
    
I dont know how merge works completely but i tried that option on another project in past, and it broke javascript functionality since may be the order of javascript files got changed –  CodeCode O-1-O-log-n Sep 17 at 14:39

1 Answer 1

up vote 1 down vote accepted

You might get away with just changing the skin_url configuration from the admin; see System -> Configuration -> General -> Web -> Secure|Unsecure -> Base Skin URL.

In your case that would mean replacing {{unsecure_base_url}}skin/ with {{unsecure_base_url}}min/?f=skin/

If that doesn't work, one way of doing it would be to overwrite the Mage_Page_Block_Html_Head block, the getCssJsHtml method; see app/code/core/Mage/Page/Block/Html/Head.php

share|improve this answer
    
Thanks, I am going to rewrite the block. –  CodeCode O-1-O-log-n Sep 17 at 18:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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