0

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.

asked Sep 17, 2015 at 14:30
2
  • 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. Commented Sep 17, 2015 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 Commented Sep 17, 2015 at 14:39

1 Answer 1

1

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

answered Sep 17, 2015 at 14:40
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.