When you add a css file through xml layout updates, the addCss
action (which actually only calls the addItem
action with the type set to skin_css
) looks for the file path, not the URL. Although the query strings are valid in the URLs, they are not specified in file names. Magento sees this as an invalid parameter, gets confused, and returns to base/default
.
I can think of 2 solutions for this. Unfortunately, both are hackers.
Move the css file to the default base theme. It works, but it depends on backups, which may not remain the same in other versions of magento.
instead of directly pasting the css file, create a phtml template file with the html code to insert the css file. Then insert the core/template
block with this new template file as its template into the xml layout. I used this method on sites that I develop to solve this problem.
source share