Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a custom module, which will add skin css

    <reference name="head">
        <action method="addItem">
            <type>skin_css</type>
            <name>css/banner.css</name>
        </action>
    </reference>

finally it includes the css for me in base theme

http://localhost/m1/skin/frontend/base/default/css/banner.css 

How can I make it load the css in current theme?

share|improve this question
    
if you put your css in your current theme magento theme fall back will do it accordingly – Minesh Patel yesterday
up vote 4 down vote accepted

Place your css in your current theme like:

skin/frontend/<package>/<theme>/css/banner.css

share|improve this answer
    
need to change layout syntax? seems cannot use additem and type if apply for solution – hkguile yesterday
    
no need to change syntex... it is proper – Jaimin Parikh yesterday
    
if i change to <name>css/banner.css</name> to skin/frontend/rwd/default/css/banner.css, the path is duplicated localhost/m1/skin/frontend/base/default/skin/frontend/rwd/… – hkguile yesterday
    
you have to set <name>css/banner.css</name> only, it willtake css form your current theme. if magento doesn't find css in current therm then it collects from base – Jaimin Parikh yesterday

If you are developing an extension and using css/js then you have to include in base/default package because when you give your extension someone else at that time you dont know which theme they are using .

That's why magento provide fallback mechanism so if you developing an extension then you have to use last fallback so your files always pickup and user can override your files by adding in own theme.

Hope this will help your concern

share|improve this answer

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.